Page 1 of 1

Problem with MySQL indexes ?

Posted: 2006-11-21 11:24
by Julien@TLD

I opened the hMailServer database with PHPMyAdmin and I see that the tables structure is strange for the indexes. In effet, each primary key of each table is also present like an index. Why creating two indexes on the same column? For me just one index (the primary key) is suffisant for optimal performances, no ?

An other thing, the table hm_messages has a primary key on messageid and also an unique key on messageid. Why? It's the same thing. Probably same behavior in other tables.

I use hMailServer 4.3 build 248 with my own 4.1 MySQL server. This indexes problem structure was also present with hMailServer 4.2. I have well upgraded the data base structure during the installation of hMailServer 4.3.

Posted: 2006-11-23 10:40
by Julien@TLD
UP ;)

Posted: 2006-11-23 12:38
by martin
Haven't had the time to look into this yet, but I know some of the indexes doesn't make sense and are redundant. Is there a performance problem for you or are you just curious?

Posted: 2006-11-23 14:28
by Julien@TLD
No, it's not really a problem for me and it's function well. I am just curious like you say :)

In fact, it could be a little performance problem on large servers because mysql have to update each time the multiple indexes instead of one.