skip to Main Content

Mysql – Order by with and without Limit clause uses different index

Can someone explain why the optimizer chooses different indexes if Limit is used? MariaDB > EXPLAIN SELECT dms_meta.docid FROM dms_meta WHERE (dms_meta.metid = 3 and dms_meta.value = '2015-10-01') ORDER BY dms_meta.docid ASC limit 25; +------+-------------+----------+-------+---------------+------------+---------+------+------+-------------+ | id | select_type |…

VIEW QUESTION

Why PostgreSQL doesn't use an index for JOIN

I have two tables "Tasks"(300k rows) and "TaskAssignedRoles"(500k rows). CREATE TABLE public."Tasks" ( "ID" uuid NOT NULL, "RowID" uuid NOT NULL, "Planned" timestamptz NOT NULL, CONSTRAINT "pk_Tasks" PRIMARY KEY ("RowID") ); CREATE INDEX "idx_Tasks_ID" ON public."Tasks" USING btree ("ID"); CREATE…

VIEW QUESTION
Back To Top
Search