0

In a lecture note which I use to learn about database systems, I saw this sentence.

All columns involved in indexes should appear on WHERE and JOIN clauses on the same sequence they appear on index.

I found this one under the title SQL Query tuning. I can't understand what it says and why.
Can you please help me understanding the sentence.
I searched google for a less complicated one but it is hard to know how to search for that.

Lasitha Yapa
  • 4,309
  • 8
  • 38
  • 57

1 Answers1

0

Not trying to be cute, but I think it means what it says.

When listing items in the join/where clauses, it improves speed to keep everything in the same order. When executing a statement, it is much faster to go top to bottom, then having to search through the statement for the connection/relationship. That is one of the main reasons for using indexes in the first place.

(I can't comment yet - sorry this is in an "answer" section)

blackandorangecat
  • 1,246
  • 5
  • 18
  • 37