Query takes a long time to return
Posted on 2008-06-10
I have a database table with about 40 columns. Of those 40 columns, 5 of them make up the primary key and a clustered index. Initially with small amounts of data, the query "Select Distinct A, B, C From TABLE Where D = 1" takes seconds to return. After months of data, the query takes minutes to return.
I have tried rebuilding and reorganizing the index with no success. However, if I remove the primary key, save the table, and then add it back, the queries begin returning in seconds again.
Does anyone know why this is. Is there something else I can do. I have a DB right now that I cannot do this do because of replication, and it seems as if removing the primary key is not the correct route to take.