Re: [PHP-DB] PHP and MySQL design question

2007-11-05 Thread Roberto Mansfield
Chris wrote: >> My point here was the if you index on (a, b), you don't need to index on >> (b, a) if both a and b are present in your where clause. The index is >> read from left to right -- not the where clause. > > Sure you do. Look at the OP's problem and you'll see you still do. > > To quote

Re: [PHP-DB] PHP and MySQL design question

2007-11-04 Thread Chris
robertom wrote: Chris wrote: Roberto Mansfield wrote: It shouldn't matter what order the columns are referenced. Mysql is smart enough to optimize the query based on the available indexes. In some cases yes but as with anything there are exceptions :) mysql (and every other db) gets it wrong

Re: [PHP-DB] PHP and MySQL design question

2007-11-02 Thread Roberto Mansfield
> Chris wrote: >> Mysql will actually only use one index per table. I was surprised to >> find this out but it's mentioned in >> http://www.amazon.com/High-Performance-MySQL-Jeremy-Zawodny/dp/0596003064/ >> - page 64 (just looked it up to include a page ref). >> >> No idea if this is mentioned anyw

Re: [PHP-DB] PHP and MySQL design question

2007-11-02 Thread robertom
Chris wrote: > Roberto Mansfield wrote: >> It shouldn't matter what order the columns are referenced. Mysql is >> smart enough to optimize the query based on the available indexes. > > In some cases yes but as with anything there are exceptions :) > > mysql (and every other db) gets it wrong some

Re: [PHP-DB] PHP and MySQL design question

2007-11-01 Thread Chris
Roberto Mansfield wrote: It shouldn't matter what order the columns are referenced. Mysql is smart enough to optimize the query based on the available indexes. In some cases yes but as with anything there are exceptions :) mysql (and every other db) gets it wrong sometimes. In fact, it shoul

Re: [PHP-DB] PHP and MySQL design question

2007-10-24 Thread Roberto Mansfield
It shouldn't matter what order the columns are referenced. Mysql is smart enough to optimize the query based on the available indexes. In fact, it should be good enough just to create an index on each column that will be searched -- not on combinations of columns. Do you have any performance number

Re: [PHP-DB] PHP and MySQL design question

2007-10-23 Thread Byte Smokers
Hello I did look into the info from EXPLAIN. I can create the indexes also but then I have to create indexes with all permutation of column order if I want to get good performance from all search query regardless of what order user enters the column. On 10/23/07, Theodoros Goltsios <[EMAIL PROTEC

Re: [PHP-DB] PHP and MySQL design question

2007-10-22 Thread Theodoros Goltsios
I guess EXPLAIN will do the job for you. First of all in order to ensure what is the index used by your queries and then how to improve performance by making the right indexes. Theodoros Goltsios Kinetix Tele.com Support Center email: [EMAIL PROTECTED], [EMAIL PROTECTED] Tel. & Fax: +30 2310556