explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 6QBA

Settings
# exclusive inclusive rows x rows loops node
1. 0.038 4,213.627 ↑ 1.0 800 1

Limit (cost=379,984.54..380,024.54 rows=800 width=122) (actual time=4,213.475..4,213.627 rows=800 loops=1)

2. 73.197 4,213.589 ↑ 306.8 800 1

WindowAgg (cost=379,984.54..392,255.54 rows=245,420 width=122) (actual time=4,213.474..4,213.589 rows=800 loops=1)

3. 296.240 4,140.392 ↓ 1.0 245,439 1

GroupAggregate (cost=379,984.54..386,733.59 rows=245,420 width=114) (actual time=3,818.171..4,140.392 rows=245,439 loops=1)

  • Group Key: i.id, boc.id
4. 116.884 3,844.152 ↓ 1.0 253,023 1

Sort (cost=379,984.54..380,598.09 rows=245,420 width=91) (actual time=3,818.154..3,844.152 rows=253,023 loops=1)

  • Sort Key: i.id, boc.id
  • Sort Method: external merge Disk: 24256kB
5. 2,828.906 3,727.268 ↓ 1.0 253,023 1

Nested Loop Left Join (cost=3.82..345,427.45 rows=245,420 width=91) (actual time=0.079..3,727.268 rows=253,023 loops=1)

  • Join Filter: (i.tags @> ARRAY[t.id])
  • Rows Removed by Join Filter: 19378023
6. 42.563 162.045 ↓ 1.0 245,439 1

Hash Left Join (cost=3.82..54,602.76 rows=245,420 width=114) (actual time=0.055..162.045 rows=245,439 loops=1)

  • Hash Cond: (i.bo_class_id = boc.id)
7. 119.460 119.460 ↓ 1.0 245,439 1

Seq Scan on bo_instance i (cost=0.00..53,921.00 rows=245,420 width=105) (actual time=0.030..119.460 rows=245,439 loops=1)

  • Filter: (NOT is_deleted)
  • Rows Removed by Filter: 161
8. 0.011 0.022 ↑ 1.0 81 1

Hash (cost=2.81..2.81 rows=81 width=17) (actual time=0.021..0.022 rows=81 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 12kB
9. 0.011 0.011 ↑ 1.0 81 1

Seq Scan on bo_class boc (cost=0.00..2.81 rows=81 width=17) (actual time=0.004..0.011 rows=81 loops=1)

10. 736.308 736.317 ↑ 1.0 79 245,439

Materialize (cost=0.00..2.19 rows=79 width=17) (actual time=0.000..0.003 rows=79 loops=245,439)

11. 0.009 0.009 ↑ 1.0 79 1

Seq Scan on tag t (cost=0.00..1.79 rows=79 width=17) (actual time=0.004..0.009 rows=79 loops=1)

Planning time : 0.388 ms
Execution time : 4,219.400 ms