Scott0_: index a,b is.

 
Nies: I was asking about my recollection hoping there would be a simple response like darwins

Correl: Scott0_: Same question again: If you have WHERE a = 1 AND b = 2; what makes you ***ume it matters if your index is a,b or b,a ?

Onukogu: Because I had a feeling I was remembering it wrong

Kienzle: Scott0_: Swancutt died long ago. He’s weak, as are we all.

Rosentrance: Salle: what makes me think that? my failed memory on the topic

Correl: Scott0_: Your ***umption is plain wrong, but you somehow insist on that.

Llano: It wasn’t an ssumption

Correl: Scott0_: So thats’s why I am asking what makes you do it

Ducksworth: There is nothing to back it up, its just a memory

Correl: Scott0_: Scroll back. You were talking about creating compound index first and then tailoring the WHERE clause to use it better. We all told you that’s plain wrong.

Feucht: Scott0_: Even if Swancutt is 99.999% correct in all his years of responses, he could be wrong this time. How will you know?

Feimster: Salle: that’s because of the memory that it was done that way before for some reason. I may have been confusing it with something else

Correl: Scott0_: Then why do you still insist on it instead of answering my question? :

Casserly: Xgc: im going to write code and then push it into production without testing once

Antis: Salle: I didn’t insist on it, you asked me why I thought it

Keiter: I don’t trust Swancutt !

Correl: Scott0_: Let’s tweak it a little: If you have WHERE a = 1 AND b = 2; what could possibly make you ***ume it matters if your index is a,b or b,a ?

Leavell: And then when I answered, you attacked it

Correl: Scott0_: No attack! You are confused and I am trying help you find why and fix it

Darwich: Salle: I answered that already, my memory of 2 years ago made me think it might be that way

Ruz: Which was clearly wrong

Keiter: Scott0_: well, I would verify your ***umption right away, then.

Bustos: Scott0_: Some things are rather simple to verify. I’m just suggesting that you worry less about what others say and “just do it”. You would have answered your own question long ago.

Wanek: An ***umption is something accepted as true or certain to happen, I did not make an ***uption. I was clear in the beginning that I may be wrong, which is why I called it a memory

Nimox: A failed memory at that

Correl: Xgc: Not really. He was quite convinced initially he can create fastest possible index first and then tailor his query for this index

Snooks: Can we not use “***umption” where it does not belong?

Keiter: Scott0_: make a small table, insert 20 rows, add an index, use EXPLAIN

Hilz: I was not convinced it was

Wybenga: I started off by saying it was a long while and I may be wrong

Emigholz: Salle: Well, that’s true. Sometimes he needs someone to push in the right direction or he’d wander off a cliff right away.

Correl: Scott0_: Ok then. Write your queries first. Just then figure out what indexes will be best for your specific queries. That’s how it works.

Keiter: Scott0_: albeit 20 rows may not suffice, but you can loop with bash to add more

Starcher: I guess I was complicating it more than it needs to be and maybe confusing it with another index building practice. Maybe regarding the use of equal and ranges

Correl: Scott0_: When you are ready with the query run it with EXPLAIN first and see what MySQL tells you. If the query plan looks good then fine. If not think what index can help and possibly ask here

Quam: I do recall placing my ranges at the end of the query for some reason

Correl: Scott0_: Regarding use of equal and range the rule is simple. The column you use with range expr goes last in the index.

Correl: Scott0_: index a,b is better for: WHERE a = 1 AND b 2; index b,a is better for WHERE a 1 AND b = 2;