Stuart McLachlan
stuart at lexacorp.com.pg
Sun Sep 5 17:25:49 CDT 2004
On 5 Sep 2004 at 11:12, John W. Colby wrote: > OK it's time to talk about how to speed things up. I now have a SQL Server > machine with (4) 250g SATA data drives each containing one file from the > database. The four files together form a single database with a single > table which as of this morning contains 27 million records. Doing a count > (*) from another machine took 18 minutes to count 24 million records. > > What can I do to speed up this count function? Repeat from my posting in this list pm Sat 21 Aug 04. There is another way to determine the total row count in a table. You can use the sysindexes system table for this purpose. There is ROWS column in the sysindexes table. This column contains the total row count for each table in your database. So, you can use the following select statement instead of above one: SELECT rows FROM sysindexes WHERE id = OBJECT_ID('table_name') AND indid < 2 -- Stuart