Tables in a database were heaps and had non-clustered primary keys. I changed the primary keys to clustered and saw a drop in performance.
This query is joining tables on clustered index keys and taking 10 secs and doing a lot more 'worktable' logical reads than a exactly same query joining the tables with nonclustered primary keys on the same columns which took 5 seconds and a lot less 'worktable' logical reads. Joins are using primary-key/foreign-key columns. Please let me know what is going wrong here that is causing performance to drop.
I will attach the Non-clustered primary keys query in a second post(NonClusteredPrimarykeys.pesession)
By wanderer 0 asked May 25 at 04:38 AM
The same question was reposted a few hours later, apparently because there were issuse with the account creation process. I will answer the more recent copy of the question.
Perhaps an admin that remove this question?
By Hugo Kornelis 271 answered May 26 at 09:01 AM