3 ms·
The trouble is that any loop you might write may be looping over the wrong thing. Probably the biggest single determinant of a SQL query's performance is the o
by barrkel 7y ago
The trouble is that any loop you might write may be looping over the wrong thing.
Probably the biggest single determinant of a SQL query's performance is the order of joins. The best join order is dependent on how many rows result after each join, which in turn depends on how selective the predicates are that can be applied to each table, and that depends on the data distribution. The database does this with statistics. That means it can change the join order - the nesting level of your respective loops - as the data distribution changes.