I have a table with a few hundred thousand lines. (It’s a precomputed table expressing the relation between lemmas of words and other big tables.) I need to do multiple sele
An index can be used to speed up sorting only if the query allows to return the rows in the order in which they are stored in the index.
This is not possible when another column with a different index is used to look rows up, or when you are returning multiple rows because of a cross join.
Try adding an index on lemId
, but this is unlikely to help with the sorting.
The sorting is slow because there are too many result before the LIMIT.