May 23, 2012

Post: Multi Range Read (MRR) in MySQL 5.6 and MariaDB 5.5

… traditional secondary index lookups, if the columns that are being fetched do not belong to the secondary index definition (and hence covering index optimization… traditional index lookup (for non-index-only columns) involves, reading an index record, and then using the PK column value in the index record…

Post: Troubleshooting MySQL Memory Usage

…’; +——————————-+ | sum(data_length+index_length) | +——————————-+ | 126984 | +——————————-+ 1 row in set (0.98 sec) This however will not cover TEMPORARY tables some of…_schema.global_temporary_tables where engine=’memory’; +——————————-+ | sum(data_length+index_length) | +——————————-+ | 126984 | +——————————-+ 1 row in set (0.00 sec) You…

Post: Covering index and prefix indexes

… to make between having prefix index – which can be significantly smaller in size and having index being covering index, which means query can be executed using only data from the index without reading the row… index which has prefix key parts as covering index if you do not touch columns which only have prefixes in the index. Notice “Using Index

Post: Multi Column indexes vs Index Merge

… see why it is the case. MySQL indexes are (with few exceptions) BTREE indexes – this index type is very good to be able… how MySQL uses the index but not exactly what it gets from the index – typically (unless it is covering index) MySQL gets a “row… to use second index and hence index merge, what does it turn to ? It is not combined index but single index on another column…

Post: 3 ways MySQL uses indexes

… single index – there are more complex rules of how indexes will be used if you look at multiple indexes usage with “index merge” Using Index… couple of columns index can be simply much smaller than the data which is one of the reason covering indexes help to speed up queries even if data is in memory. If MySQL is only reading index and not…

Post: Explaining Indexes with a Library Metaphor

… title in the library. Not using an index If you are not using the index cards, you would have to go shelf… on the hard disk when its not using an index. Using an index You are interested in a book by J.R… saved yourself from walking over to the shelves. Using a covering index You are interested to know how many pages a certain…

Post: Redundant index is not always bad

… year ago Peter wrote about redundant indexes and mentioned sometimes it is good to leave two indexes, even one is first part… technique we use for such queries is covering index, which store all needed columns in the index, and there is no need to… – 470sec (Here I limited available memory to fit only one index, that shows how can degrade performance if we balance on…

Comment: A rule of thumb for choosing column order in indexes

… sense to consider is covering index potential in particular when trying to target several query patterns with single indexes. Covering index slows down queries which can’t use it as covering index because it is longer but speeds up queries which can use covering index

Comment: Duplicate indexes and redundant indexes

… a longer non-unique and non-covering index could give worse performance over a shorter unique index that is the prefix of the… would not have been wasted if the longer index would’ve been a covering index?) I think that is an intersting case too… it kind of approaches Oracle’s index organized tables (IOT’s), which are essentially a big covering index instead of a proper table…

Post: Is it query which needs to be optimized ?

… is not too large using covering index ie (STATE_ID,CITY_ID,GENDER) is great because scanning index is frequently makes COUNT 5… two queries, because it will not be able to use covering index to compute the rows. If the number of combinations is… efficient – make sure all where clauses are using indexes, try to have queries index covered and avoid joins as much as possible. ORDER…