Board index » delphi » TQuery, RecordCount & speed

TQuery, RecordCount & speed

No particular question or problem to be answered here, just my
observations on these things - if anyone would like to correct me, or
explain, I would be most appreciative.

My system:
-Delphi 1 on W311
-Master table, 20mb, 30,000 rows, no memos; TQuery, on main form. Single
table selected from - CUST.db.
-4 dependent tables & a number of lookups (small), the dependents  
 have look-ups too - i.e. a pretty standard normalised set-up.
-All Paradox.
-All subforms use MainForm.CustQuery to access the Query directly. Where
applicable, subforms have a DataSource which is attached to the
MainForm.CustQuery at runtime.

One user option is to have r/w access to all the rows in CUST on a
detail form, which itself has a selection sub-form. This subform is a
simple SQL generator.

So, when the detail form appears, I use: SELECT * FROM CUST; in the
OnShow:

If I have RequestLive = TRUE just before the Open:
- the query works instantly,
- The First/Last/Next/Prior navigation buttons work instantly.
- The details are editable & reflected in the MainForm when posted.
- (The recordcount is the whole table anyway)
- Calling up the selection subform, I generate something like:
- SELECT * from CUST
- WHERE (LASTNAME > "E") AND (LASTNAME < "P");
- If I have RequestLive = TRUE just before the Open:
--- This query return instantly
--- Record count is wrong (it doesn't change)
--- The First/Last/Next/Prior navigation buttons work instantly.
--- The details are editable
- If I have RequestLive = FALSE just before the Open:
--- This query takes 20 seconds
--- Record count is correct
--- The First/Last/Next/Prior navigation buttons work instantly.
--- The details are not editable

If I have RequestLive = FALSE
- The query takes about 40 seconds
- The First/Last/Next/Prior navigation buttons work instantly.
- The details are not editable.
- (The recordcount is the whole table anyway)
- Calling up the selection subform, I generate something like:
- SELECT * from CUST
- WHERE (LASTNAME > "E") AND (LASTNAME < "P");
- If I have RequestLive = TRUE just before the Open:
--- This query return instantly
--- Record count is wrong (it doesn't change)
--- The First/Last/Next/Prior navigation buttons work instantly.
--- The details are editable.
- If I have RequestLive = FALSE just before the Open:
--- This query takes 20 seconds
--- Record count is correct
--- The First/Last/Next/Prior navigation buttons work instantly.
--- The details are editable (on the detail form).

It seems: RequestLive = TRUE for fast response & incorrect RecordCount.
I haven't been able to get 'Everything', at the same time.

Any thoughts would be appreciated.
--
Stephen Kenny

 

Re:TQuery, RecordCount & speed


Quote
>It seems: RequestLive = TRUE for fast response & incorrect RecordCount.
>I haven't been able to get 'Everything', at the same time.

Request live is equivalent to filtering the table.  BDE does not know
how many records meet the filter criteria because it only looks far
enough in the table to fill the display.

When you have request live set to false BDE generates a complete copy
of all the records that meet your selection criteria.

--
Brian Bushay (TeamB)
Bbus...@DataGuidance.com

Other Threads