D
D
DTX2017-02-01 14:24:06
MySQL
DTX, 2017-02-01 14:24:06

What index to create for quick sorting and selection?

You need to optimize queries like this:

SELECT *
FROM table
WHERE id > &id
ORDER BY rank
LIMIT 10

Which index/indexes should be added?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
lega, 2017-02-01
@DirecTwiX

If id is an enumerator and rank is a integer, then one index on two columns [id, rank]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question