АК
Size: a a a
АК
VY
НК
SELECT "lot".*, "torg"."published_at"как можно ускорить сортировку в данном примере?
FROM "eidb"."lot"
LEFT JOIN "eidb"."torg" ON "eidb"."lot"."torg_id" = "eidb"."torg"."id"
ORDER BY "torg"."published_at" DESC
LIMIT 8;
Limit (cost=206165.73..206166.66 rows=8 width=1034)так понимаю, что созданный индекс
-> Gather Merge (cost=206165.73..260276.71 rows=463776 width=1034)
Workers Planned: 2
-> Sort (cost=205165.71..205745.43 rows=231888 width=1034)
Sort Key: torg.published_at DESC
-> Parallel Hash Left Join (cost=6874.35..200527.95 rows=231888 width=1034)
Hash Cond: (lot.torg_id = torg.id)
-> Parallel Seq Scan on lot (cost=0.00..193044.88 rows=231888 width=1026)
-> Parallel Hash (cost=6065.82..6065.82 rows=64682 width=16)
-> Parallel Seq Scan on torg (cost=0.00..6065.82 rows=64682 width=16)
create index "idx-torg-published_at-desc"в запросе не используется
on eidb.torg (published_at desc);
VY
eidb.lot.torg_id
индекс есть?НК
eidb.lot.torg_id
индекс есть?VY
ON eidb.torg (id, published_at DESC)
YS
SELECT "lot".*, "torg"."published_at"как можно ускорить сортировку в данном примере?
FROM "eidb"."lot"
LEFT JOIN "eidb"."torg" ON "eidb"."lot"."torg_id" = "eidb"."torg"."id"
ORDER BY "torg"."published_at" DESC
LIMIT 8;
Limit (cost=206165.73..206166.66 rows=8 width=1034)так понимаю, что созданный индекс
-> Gather Merge (cost=206165.73..260276.71 rows=463776 width=1034)
Workers Planned: 2
-> Sort (cost=205165.71..205745.43 rows=231888 width=1034)
Sort Key: torg.published_at DESC
-> Parallel Hash Left Join (cost=6874.35..200527.95 rows=231888 width=1034)
Hash Cond: (lot.torg_id = torg.id)
-> Parallel Seq Scan on lot (cost=0.00..193044.88 rows=231888 width=1026)
-> Parallel Hash (cost=6065.82..6065.82 rows=64682 width=16)
-> Parallel Seq Scan on torg (cost=0.00..6065.82 rows=64682 width=16)
create index "idx-torg-published_at-desc"в запросе не используется
on eidb.torg (published_at desc);
НК
АЛ
YS
АЛ
НК
АЛ
НК
НК
YS
НК
YS
НК
eidb.lot.torg_id
индекс есть?НК