Exponential growth of the slots table

Phil Longstaff plongstaff at rogers.com
Sat Dec 4 01:42:09 EST 2010


The slots table contains extra information for the other objects.  This extra 
information allows extra values to be tied onto objects.  It will be loaded and 
saved with the objects.  When loaded, the slots are like a directory structure.  
At each level, there are named keys with values of different types (int, string, 
date, ...).  There can also be sub-levels.

The main key is the guid field which contains the guid of the object that this 
slot belongs to.  This object can be of any other type (account, split, 
transaction, book, ...).  The other fields in the slot table are the full 
directory path of the key, the value type, and the value.

I believe that guid/path should be unique.

 Phil
---------
I used to be a hypochondriac AND a kleptomaniac. So I took something for it.




________________________________
From: Elwood Hunt <elwood.hunt at gmail.com>
To: John Ralls <jralls at ceridwen.us>
Cc: gnucash-user at gnucash.org
Sent: Sat, December 4, 2010 1:10:32 AM
Subject: Re: Exponential growth of the slots table

If I run this query:

SELECT name, count(*)
  FROM slots
GROUP BY name
HAVING COUNT(*) > 2;

I get approx. 300 rows back, most of them having a count of 54 (meaning I
have 300 slot names with each having 53 duplicates = 15,900 extra rows).  I
have a good understanding of relational databases but I'm totally clueless
on how this slots table works.  Any documentation would be appreciated.

Thanks,
Elwood

On Fri, Dec 3, 2010 at 8:48 PM, John Ralls <jralls at ceridwen.us> wrote:

>
> On Dec 3, 2010, at 7:23 PM, Elwood Hunt wrote:
>
> > Hi,
> >
> > I am using version 2.3.16 with MySQL as the database.  For backups, I
> will
> > often use MySQL Administrator to export the entire schema to an SQL DDL
> > file.  I recently noticed that the size of my backup file grew from ~
> 800K
> > to  ~ 2.8MB after adding a budget for one month (I have maybe 25 expense
> > accounts).  I also noticed that it was the slots table that grew so much
> > (several thousand additional rows).  Is this normal or did something go
> > wrong?
> >
>
> Maybe both.
>
> Nested slots weren't supported until 2.3.16 -- and it's something depended
> upon by several features, including budgeting and  account mapping for
> imported transactions. The slots architecture doesn't map very well into the
> relational model, so it's not very efficient in terms of either space or
> performance. (More like it's very inefficient.)
>
> It's also possible that slots are being duplicated when they're written
> out. If you're able, find a slot name and then query in the mysql shell to
> see if there are duplicates.
>
> Regards,
> John Ralls
>
>
_______________________________________________
gnucash-user mailing list
gnucash-user at gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-user
-----
Please remember to CC this list on all your replies.
You can do this by using Reply-To-List or Reply-All.


More information about the gnucash-user mailing list