Nearly all database operations for my application have all been placed in large CTE batches.
This has dramatically improved performance; however, determining existence to maintain data integrity seems to be overly processor intensive.
I used case to short circuit, and this also has dramatically boosted performance.
I have now found that replacing sequence scans with index usage also boosts performance.
In my data's case, there are very few indexes, but every index can be used to make the above determination and are mostly integers with some larger byteas. All existence queries are now reduced to the most trivial with very few conditions because of the many cases. Unindexed columns are never compared for this purpose.
Why are sequential scans preferred, and in this special case of extremely processor intensive queries with small indexes, is this an exception? If it is an exception, how can query planning be altered to force total index usage?
Aucun commentaire:
Enregistrer un commentaire