explain.depesz.com

PostgreSQL's explain analyze made readable

Result: QIeD

Settings
# exclusive inclusive rows x rows loops node
1. 0.424 515.092 ↑ 2,806.0 1 1

Nested Loop (cost=251.57..54,775.21 rows=2,806 width=171) (actual time=87.667..515.092 rows=1 loops=1)

2. 2.601 3.696 ↓ 1.4 3,871 1

HashAggregate (cost=232.18..260.24 rows=2,806 width=23) (actual time=2.405..3.696 rows=3,871 loops=1)

  • Group Key: dockets_items.code, dockets_items.supplier_number, dockets_items.project_id
3. 1.095 1.095 ↓ 1.0 5,086 1

Seq Scan on dockets_items (cost=0.00..194.39 rows=5,039 width=23) (actual time=0.003..1.095 rows=5,086 loops=1)

4. 0.000 510.972 ↓ 0.0 0 3,871

Subquery Scan on items (cost=19.39..19.41 rows=1 width=171) (actual time=0.132..0.132 rows=0 loops=3,871)

  • Filter: (items.id = 4,461)
  • Rows Removed by Filter: 1
5. 3.871 510.972 ↑ 1.0 1 3,871

Limit (cost=19.39..19.40 rows=1 width=171) (actual time=0.131..0.132 rows=1 loops=3,871)

6. 7.742 507.101 ↑ 1.0 1 3,871

Sort (cost=19.39..19.40 rows=1 width=171) (actual time=0.131..0.131 rows=1 loops=3,871)

  • Sort Key: items_1.active_from DESC, items_1.modified_at DESC
  • Sort Method: quicksort Memory: 25kB
7. 112.259 499.359 ↑ 1.0 1 3,871

Bitmap Heap Scan on dockets_items items_1 (cost=15.35..19.38 rows=1 width=171) (actual time=0.116..0.129 rows=1 loops=3,871)

  • Recheck Cond: (((supplier_number)::text = (dockets_items.supplier_number)::text) AND (project_id = dockets_items.project_id))
  • Filter: ((code = dockets_items.code) AND (now() > active_from) AND ((deleted_at = '-infinity'::timestamp without time zone) OR (deleted_at < now())))
  • Rows Removed by Filter: 95
  • Heap Blocks: exact=51,710
8. 7.742 387.100 ↓ 0.0 0 3,871

BitmapAnd (cost=15.35..15.35 rows=1 width=0) (actual time=0.100..0.100 rows=0 loops=3,871)

9. 54.194 54.194 ↓ 4.7 107 3,871

Bitmap Index Scan on dockets_items_supplier_number_idx (cost=0.00..4.46 rows=23 width=0) (actual time=0.014..0.014 rows=107 loops=3,871)

  • Index Cond: ((supplier_number)::text = (dockets_items.supplier_number)::text)
10. 325.164 325.164 ↓ 3.0 958 3,871

Bitmap Index Scan on dockets_items_project_id_idx (cost=0.00..10.65 rows=315 width=0) (actual time=0.084..0.084 rows=958 loops=3,871)

  • Index Cond: (project_id = dockets_items.project_id)
Planning time : 0.191 ms
Execution time : 515.154 ms