Re: How can I count rows fast ?

From: Barry Roomberg <barry.roomberg_at_compudata.com>
Date: Sun, 12 Jun 94 16:26:00 -0500
Message-ID: <12a.2622.905_at_compudata.com>


-> : 'SELECT COUNT(*)' in Oracle V. 6 or 7 ? I've heard from some
-> : expirience with using 'SELECT COUNT(<index>)' to be faster, but

SELECT COUNT(FIELD) FROM TABLE WHERE FIELD > ' '; Assuming a non null, non space only indexed field, this will force a count by index, on V6 & V7.

The "FIELD > ' '" is require on V6 since it will NOT use the index by default, and under V7 if you are not collecting stats on that table. Received on Sun Jun 12 1994 - 23:26:00 CEST

Original text of this message