Bug #38695 | Index usage with Maria | ||
---|---|---|---|
Submitted: | 9 Aug 2008 22:32 | Modified: | 10 Aug 2008 6:10 |
Reporter: | Ricardo Sal | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server: Maria storage engine | Severity: | S5 (Performance) |
Version: | latest | OS: | Windows (xp) |
Assigned to: | CPU Architecture: | Any | |
Tags: | Maria index performance |
[9 Aug 2008 22:32]
Ricardo Sal
[10 Aug 2008 6:10]
Michael Widenius
The problem is that as you add more index, the b-tree will be more spread out on disk and there will be more seeks when reading the index to the page cache. This is the nature of b-trees and all engines that uses b-trees should have similar problems. Possible solutions: - Run OPTIMIZE TABLE once in a while. This will sort the index file in access order - Set up bigger page cache so that the needed pages fits into memory (This may not your problem as the second query is faster, but I thought I would mention it anyway) - Use LOAD INDEX command to load the index into the page cache. This uses sequentail reading of the index file and should thus be fast. It's of course also possible that your problem is a bug, but in that case we would need a test case to be able to repeat your problem. When we are ready with Maria 2.0 (December?) we will start doing extensive benchmarks to see what things we need to improve. I will ensure that we then will also do test with many index to test index degradation As a side note, we will soon fix in Maria (probably in 2.0) that add index and drop index only generate/drop the new index. This will make creating/dropping index significantly faster..