explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Qnki

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

Limit (cost=349,610.59..349,650.59 rows=800 width=122) (actual time=4,394.387..4,394.534 rows=800 loops=1)

2. 75.405 4,394.496 ↑ 310.2 800 1

WindowAgg (cost=349,610.59..362,019.79 rows=248,184 width=122) (actual time=4,394.386..4,394.496 rows=800 loops=1)

3. 305.569 4,319.091 ↓ 1.0 248,197 1

GroupAggregate (cost=349,610.59..356,435.65 rows=248,184 width=114) (actual time=3,986.339..4,319.091 rows=248,197 loops=1)

  • Group Key: i.id, boc.id
4. 123.812 4,013.522 ↓ 1.0 255,781 1

Sort (cost=349,610.59..350,231.05 rows=248,184 width=91) (actual time=3,986.321..4,013.522 rows=255,781 loops=1)

  • Sort Key: i.id, boc.id
  • Sort Method: external merge Disk: 24544kB
5. 3,026.225 3,889.710 ↓ 1.0 255,781 1

Nested Loop Left Join (cost=3.82..314,646.00 rows=248,184 width=91) (actual time=0.051..3,889.710 rows=255,781 loops=1)

  • Join Filter: (i.tags @> ARRAY[t.id])
  • Rows Removed by Join Filter: 19595905
6. 45.041 118.894 ↓ 1.0 248,197 1

Hash Left Join (cost=3.82..20,545.97 rows=248,184 width=95) (actual time=0.027..118.894 rows=248,197 loops=1)

  • Hash Cond: (i.bo_class_id = boc.id)
7. 73.834 73.834 ↓ 1.0 248,197 1

Seq Scan on bo_instance i (cost=0.00..19,856.58 rows=248,184 width=86) (actual time=0.005..73.834 rows=248,197 loops=1)

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

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

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

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

10. 744.580 744.591 ↑ 1.0 79 248,197

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

11. 0.011 0.011 ↑ 1.0 79 1

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

  • Filter: (NOT is_deleted)
Planning time : 0.255 ms
Execution time : 4,401.375 ms