Subject Re: [firebird-support] Indexing for Min and Max
Author dhay@lexmark.com
Hi Artur,

Thanks for the reply - I'll probably just do the [ugly] SQL I mentioned
rather than bother with an extra table. It gives pretty good performance.

Cheers,

David




"Artur Anjos" <artur@...> on 10/10/2003 02:27:49 PM

Please respond to firebird-support@yahoogroups.com

To: <firebird-support@yahoogroups.com>
cc:
Subject: Re: [firebird-support] Indexing for Min and Max



Hi David,

> Is there a way to get count(id) to use the primary key / an index? What
I
> am trying to do here is actually get the count of records very fast - I
> have up to a million records in there.

count(*) will make the engine do something more than counting, so you will
have always this delay. (Look in IBPhoenix for more information about this,
spesial focus on deleted records).

If you need this info very often, may I suggest to create a table with this
info, and update this table with triggers after insert / after delete on
your big table. This will solve your speed problems.

Artur



To unsubscribe from this group, send an email to:
firebird-support-unsubscribe@yahoogroups.com



Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/