GnuCash Daily Source Diff

Dave Peticolas dave@krondo.com
25 Oct 2001 00:22:16 -0700


--=-h8s29QsWDUSWIPv9jrXG
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

On Fri, 2001-10-19 at 12:00, Linas Vepstas wrote:
> I suspect, am not sure, that my biggest design mistake was making the
> guid the 'primary key'.  I beleive that there might be a big performance
> boost are (or at least, a more consistent behaviour) if the iguid was
> made primary key.
>=20
> sql db's use the 'primary key' is the primary index into whatever
> hash-table/b-tree they use to index the data. Clearly, an 'int' compare
> would be much faster than a string compare.  I assumed, falsely, I
> surmise, that postgres would be smart enough to replace my string
> primary key with an int, but that doesn't exactly seem to be the case.
> So I assume that using iguid as the primary key should improve
> performance.

Ok, so say I wanted to change the postgres backend to use the iguid
values as primary keys. I would need to:

1. Change the table creation sql commands to create the new tables
   correctly.
2. Add update code to modify existing tables to change the primary
   keys.
3. Modify sql commands to use iguids instead of guids where appropriate.

Anything else?


> The other thing I noticed was that seemingly inconsequential changes
> made big differences in performance, sometimes by 20% or so, sometimes
> by factors of 3 or 5.  This seemed a rather unstable situation, and=20
> ... well, I'm not sure what to recommend.  Just be careful; seemingly
> idempotent changes to the sql queries can make a big impact on
> performance.

Yes, I've noticed that, too. I also noticed the documentation for the
balance checkpoints and the note to the effect that most queries will
end up pulling in everything due to the way that checkpointing works.
Is that still true? How would you suggest fixing that? Using fixed-time
intervals for checkpoints?

dave


--=-h8s29QsWDUSWIPv9jrXG
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQA7172o5effKKCmfpIRAtswAKCFCGVrRTGVsyyZQSR8oUPvxGigEQCgnxvH
avxcvYca+DZy0r+Q86R/Ang=
=Sit/
-----END PGP SIGNATURE-----

--=-h8s29QsWDUSWIPv9jrXG--