I have a table storing hourly production counts from multiple heads on multiple machines on multiple lines. So it gets huge very fast. 10-25 million records.
The primary key for the table consists of 7 columns which define exactly which head/machine/line/etc and the timestamp. There 3 more columns that hold the production and defect counts.
Due to this table being ported from an Oracle instance, all the field datatypes are numeric(precision 10), except the timestamp. I can *probably* change this if needed.
The PK is clustered. Is there anything glaringly wrong with the way the PK is setup? Is there something I should look at adjusting with SQL server itself?
The queries used are sometimes as simple as this:
Select * from table where timestamp >= '4/18/2008 6:30:00 am'
A query like that can take 3-5 minutes. If I try filtering on other fields it only gets worse. Is there a potential problem using a text string to compare the datetime timestamp against maybe?
I feel like SQL server should be able to handle this amount of data and have similar performance as an Oracle instance with the same table structure and queries.
I have maintenance jobs setup to update statistics and index pages once a week.
The primary key for the table consists of 7 columns which define exactly which head/machine/line/etc and the timestamp. There 3 more columns that hold the production and defect counts.
Due to this table being ported from an Oracle instance, all the field datatypes are numeric(precision 10), except the timestamp. I can *probably* change this if needed.
The PK is clustered. Is there anything glaringly wrong with the way the PK is setup? Is there something I should look at adjusting with SQL server itself?
The queries used are sometimes as simple as this:
Select * from table where timestamp >= '4/18/2008 6:30:00 am'
A query like that can take 3-5 minutes. If I try filtering on other fields it only gets worse. Is there a potential problem using a text string to compare the datetime timestamp against maybe?
I feel like SQL server should be able to handle this amount of data and have similar performance as an Oracle instance with the same table structure and queries.
I have maintenance jobs setup to update statistics and index pages once a week.