Skip to content
Commit ae787c64 authored by Daniel Vrátil's avatar Daniel Vrátil 🤖
Browse files

Add sorting indexes for PimItemTable and friends

FetchHelper always retrieves data from DB as "ORDER BY PimItemTable.id DESC",
which is costly, because PKs are always assumed to be ascending, thus DB has
to costly calculate the sorting. This patch creates new DESC index on relevant
columns to speed up the sorting. In some cases this reduces query runtime by
50% (measured on PSQL).

Note that while all 3 backends support the syntax, only PostgreSQL and partially
SQLite actually make use of the DESC sorting index. MySQL just ignores the
keywords. SQLite support depends on version and database file format.

See T628 on Phabricator for more details and measurements.
parent 54e1f097
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment