View Issue Details

IDProjectCategoryView StatusLast Update
0003169mantisbtsqlpublic2005-07-23 02:11
Reporterrufinus Assigned Tograngeway  
PrioritynoneSeverityfeatureReproducibilityN/A
Status closedResolutionfixed 
Product Version0.18.0a4 
Fixed in Version1.0.0a1 
Summary0003169: Database dont use indexes.
Description

Database dont use indexes (or just on the PK) i modified the sql file and added some indexes, which speeds up mantis a lot. (ok the indexes need more room on the HDD, but HDD's are cheap :)

http://eisbaer.pixelwings.com/db_generate.sql

TagsNo tags attached.

Relationships

has duplicate 0003412 closedgrangeway add index to mantis_bug_file_table 

Activities

jfitzell

jfitzell

2003-05-06 18:25

reporter   ~0004307

Agreed. The last time this was done there were way too many indexes added and it really slowed down inserts and updates and made the schema more confusing. We've been focusing on reducing the number of queries be perform first, and then we can take a serious look at which indexes we really want. If you feel like giving more details on which columns you indexed, though, that would be useful.

jfitzell

jfitzell

2003-05-06 18:26

reporter   ~0004308

oh, just noticed you gave a link. Well if you feel like enumerating them, it might still be useful, but I guess when someone comes to do this they'll have no problem looking at the generate script.

rufinus

rufinus

2003-05-07 10:43

reporter   ~0004311

hi, i added indexes mostly on int fields. most of the tables have one index with all fields which could be from interest. (have a other project where such indexes add a 400-800% performance burst, http://oe1app1.orf.at/index.php if somone is intrested in)
My expirience with indexes is, if you add more than one index to a table things getting slower because mysql search all indexes for the required data. if you have only one index with all fields (mostly int or enum fields) mysql have to search only in the index to find the PK for the query.

Maybe someone with tons of bugs could test it and makes some performance tests.

jfitzell

jfitzell

2003-05-07 19:16

reporter   ~0004312

Interesting... that doesn't really make sense. If you have an index with all of the fields, that's just like another copy of the table - it shouldn't make things any faster. The point of an index is that you can make a b-tree, for example, of integer values or a hash-table of string values so that when you ask for a row with a particular value in that column, you can pull out the rows very quickly instead of having to do a linear search through the whole table.

There are times when a query will actually be faster with a linear search than with several index searches though. And queries that do, for example "LIKE '%foo%'" aren't helped by hashtable indexes at all. Judicious use of EXPLAIN while testing indexes can be very enlightening.

Sire

Sire

2004-05-19 09:13

reporter   ~0005543

Is it true that Mantis doesn't use indexes (except for PKs)?? Atleast add indexes for the most commonly used queries and you'll se a HUGE speed boost.

Just do the most important ones first, if you don't have time with a more thorough analysis.

grangeway

grangeway

2005-07-16 17:39

reporter   ~0010817

I belive most sensible indexes are added in 1.0 and onwards