[Lazarus] RE : TQuery.Open 100x slower than same code using PostrgreSQL

Howard Lee Harkness howard.lee.harkness at gmail.com
Mon Feb 6 21:17:13 CET 2012


After several hours (over a period of a couple of months) of battling this
problem, I finally found the cause. I was not looking in the right place.
Turns out that I had a dependent query that were being opened after the
client TQuery. Actually, there were 3 different dependent queries, only one
of which was causing the problem. On my system, I never ran into the
problem, primarily because my testing was not comprehensive enough -- and
the attorney ran into it almost immediately every time he used it (and he
just complained that it was too slow). I finally just recorded *exactly*
what he was doing, and then easily duplicated the problem.

The problem query was the "cases" table, which has a client ID foreign key,
an OID (primary key), a date and a large text field. PostgreSQL did not
have any slowdown at all with this database schema, so I was surprised to
see that SQLite took two orders of magnitude longer to open that same table.

What I did was simply close the case table whenever doing the incremental
search. That works, although it seems to be a bit of a hack.



On Sun, Aug 7, 2011 at 3:08 AM, Ludo Brands <ludo.brands at free.fr> wrote:

> >
> > There has GOT to be something I'm not understanding. I
> > thought SQLite was going to speed things up, not slow them down.
> >
>
> Clearly you are not providing enough information to reproduce the problem.
> So far it has all been guess work for people trying to help. Fe. your
> initial request for help "forgot" to mention that there were several
> dependant queries. If you upload the project we can take a look at it. Data
> aren't needed. Populating with random data is easy. Seen the size of your
> project (I guess this mailing list has attachment size limits) upload it
> somewhere and post the link.
>
> Ludo
>
>
> --
> _______________________________________________
> Lazarus mailing list
> Lazarus at lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>



-- 
Howard Lee Harkness
(214) 390-4896
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20120206/5ee8c876/attachment-0002.html>


More information about the Lazarus mailing list