DEV Community

Discussion on: Working with Legacy, a tale of a slow query.

Collapse
 
hwolfe71 profile image
Herb Wolfe

I noticed you don't mention indexes. Are the tables properly indexed for your queries? Those can speed up the query significantly as well.

Collapse
 
willmenn profile image
William Ahrons • Edited

Hi Herb, I forgot to mention that, so the query was time-based, so adding an index in that column was to sparsed, and the other column that we were filtering was not giving that much of division in the table, so basically if we add an index in the other column we would divide the table into 100 small ones. That answer your question?

The query was basically: Select all records from the lastweek for my store.