explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 5gTK

Settings
# exclusive inclusive rows x rows loops node
1. 0.039 3,944.501 ↑ 1.0 800 1

Limit (cost=1,070,136.60..1,070,166.60 rows=800 width=114) (actual time=3,942.178..3,944.501 rows=800 loops=1)

2. 1.946 3,944.462 ↑ 911.0 800 1

GroupAggregate (cost=1,070,136.60..1,090,179.12 rows=728,819 width=114) (actual time=3,942.177..3,944.462 rows=800 loops=1)

  • Group Key: boc.id, i.id
3. 154.223 3,942.516 ↑ 237.3 3,071 1

Sort (cost=1,070,136.60..1,071,958.65 rows=728,819 width=91) (actual time=3,942.154..3,942.516 rows=3,071 loops=1)

  • Sort Key: boc.id, i.id
  • Sort Method: external merge Disk: 24248kB
4. 2,888.962 3,788.293 ↑ 2.9 253,023 1

Nested Loop Left Join (cost=3.82..924,428.12 rows=728,819 width=91) (actual time=0.116..3,788.293 rows=253,023 loops=1)

  • Join Filter: (i.tags @> ARRAY[t.id])
  • Rows Removed by Join Filter: 19378023
5. 43.290 163.014 ↑ 3.0 245,439 1

Hash Left Join (cost=3.82..60,775.62 rows=728,819 width=114) (actual time=0.083..163.014 rows=245,439 loops=1)

  • Hash Cond: (i.bo_class_id = boc.id)
6. 119.695 119.695 ↑ 3.0 245,439 1

Seq Scan on bo_instance i (cost=0.00..58,758.54 rows=728,819 width=105) (actual time=0.049..119.695 rows=245,439 loops=1)

  • Filter: (NOT is_deleted)
  • Rows Removed by Filter: 161
7. 0.014 0.029 ↑ 1.0 81 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 12kB
8. 0.015 0.015 ↑ 1.0 81 1

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

9. 736.304 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)

10. 0.013 0.013 ↑ 1.0 79 1

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

Planning time : 0.326 ms
Execution time : 3,947.449 ms