March 6th, 2012, 10:20 AM
Count() speed, generic performance in large table
I've got a database (single-table, currently) in SQL 05; it has > 100,000,000 rows.
this simple query:
takes > 6 minutes to execute. transaction_id is the primary key on the table [bigint]; although there is no index on event_date [the data was imported from a different system and i'm migrating the data in place to SQL-friendly types]
select COUNT(transaction_id) from muni_data where event_date is null
Anyhow, short question, as I'm new to MSSQL but modestly experienced with MySQL. What's the simplest way to speed this up?
March 6th, 2012, 01:07 PM
use COUNT(*), and add an index on event_date
Originally Posted by manzellb