Re: Number of Records
- From: Sundial Services <info@xxxxxxxxxxxxxxxxxxx>
- Date: Sun, 09 Oct 2005 22:02:33 -0400
Denis Jobin wrote:
> I have a table with over 600,000 records, and it will be growing in the
> future.
> The table has a Primnary key with a single field in the key.
> I want to display the info on a form.
>
> What would be the best way of getting the number of records?
>
> - a field on the form linked to the table in the DataModel using "Number
> of Records"
> - a Tcursor and use nRecords()
> - a Tcursor, go to the end of the table and use RecNo()
> - a Query and calc count
Believe it or not, 600k records is 'not that many' as long as you have an
effective index. If the computer can use an index to zero-in on a subset
of the records, without having to read and examine the contents of each
one, everything will be (and will remain) very fast indeed.
Use a SetRange to get to the subset of records you want to consider.
Forget about "RecNo."
Don't do a query, because that would cause the computer to consider every
range that exists, and the count of records in every range ... not just the
one range that you are presently interested in.
-----------------------
ChimneySweep(R): Fast(!) table maintenance at a click of the mouse!
http://www.sundialservices.com
.
- References:
- Number of Records
- From: Denis Jobin
- Number of Records
- Prev by Date: Re: Changing dates
- Next by Date: Re: SQL --> SetRange
- Previous by thread: Re: Number of Records
- Next by thread: JSI setup
- Index(es):
Relevant Pages
|