Subject | RE: [firebird-support] Plan natural in select count().... |
---|---|
Author | RB Smissaert |
Post date | 2009-12-19T17:19:16Z |
Does it make any difference (in speed) as to what field of a table you
count?
If you only want the number of records is there any point in doing anything
else than
select count(*) from table
RBS
-----Original Message-----
From: firebird-support@yahoogroups.com
[mailto:firebird-support@yahoogroups.com] On Behalf Of Dimitry Sibiryakov
Sent: 19 December 2009 09:29
To: firebird-support@yahoogroups.com
Subject: Re: [firebird-support] Plan natural in select count()....
queries?
No way. Index by ID is useless for counting. Any index is useless for
counting.
SY, SD.
------------------------------------
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Visit http://www.firebirdsql.org and click the Resources item on the main
(top) menu. Try Knowledgebase and FAQ links !
Also search the knowledgebases at http://www.ibphoenix.com
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Yahoo! Groups Links
count?
If you only want the number of records is there any point in doing anything
else than
select count(*) from table
RBS
-----Original Message-----
From: firebird-support@yahoogroups.com
[mailto:firebird-support@yahoogroups.com] On Behalf Of Dimitry Sibiryakov
Sent: 19 December 2009 09:29
To: firebird-support@yahoogroups.com
Subject: Re: [firebird-support] Plan natural in select count()....
> When I do a SELECT COUNT(ID) FROM EMPLOYEES I always get a natural planeven if I have an index for ID, how can I get fasters select count()
queries?
No way. Index by ID is useless for counting. Any index is useless for
counting.
SY, SD.
------------------------------------
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Visit http://www.firebirdsql.org and click the Resources item on the main
(top) menu. Try Knowledgebase and FAQ links !
Also search the knowledgebases at http://www.ibphoenix.com
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Yahoo! Groups Links