explain.depesz.com

PostgreSQL's explain analyze made readable

Result: jku : Optimization for: plan #za6

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 0.001 1.075 ↑ 37.0 6 1

Unique (cost=6,939.46..6,940.57 rows=222 width=201) (actual time=1.072..1.075 rows=6 loops=1)

2. 0.012 1.074 ↑ 27.8 8 1

Sort (cost=6,939.46..6,940.02 rows=222 width=201) (actual time=1.072..1.074 rows=8 loops=1)

  • Sort Key: ri.object_id
  • Sort Method: quicksort Memory: 27kB
3. 0.023 1.062 ↑ 27.8 8 1

Group (cost=2,393.13..6,930.81 rows=222 width=201) (actual time=0.950..1.062 rows=8 loops=1)

  • Group Key: o.id, ri.role_id, ri.object_id, tct.name, ri.rightholder_id
4. 0.045 0.927 ↑ 5.5 40 1

Sort (cost=2,393.13..2,393.69 rows=222 width=117) (actual time=0.923..0.927 rows=40 loops=1)

  • Sort Key: o.id, ri.role_id, ri.object_id, tct.name, ri.rightholder_id
  • Sort Method: quicksort Memory: 34kB
5. 0.027 0.882 ↑ 5.5 40 1

Nested Loop Left Join (cost=1.98..2,384.48 rows=222 width=117) (actual time=0.053..0.882 rows=40 loops=1)

6. 0.011 0.775 ↑ 1.5 40 1

Nested Loop Left Join (cost=1.55..1,135.70 rows=61 width=133) (actual time=0.046..0.775 rows=40 loops=1)

7. 0.071 0.644 ↑ 1.5 40 1

Nested Loop Left Join (cost=1.12..1,055.20 rows=61 width=96) (actual time=0.040..0.644 rows=40 loops=1)

  • Join Filter: (tck.contract_type_id = tct.id)
  • Rows Removed by Join Filter: 440
8. 0.033 0.533 ↑ 1.5 40 1

Nested Loop Left Join (cost=1.12..1,053.27 rows=61 width=80) (actual time=0.030..0.533 rows=40 loops=1)

9. 0.018 0.460 ↑ 1.5 40 1

Nested Loop (cost=0.85..1,035.12 rows=61 width=80) (actual time=0.026..0.460 rows=40 loops=1)

10. 0.021 0.238 ↓ 1.1 68 1

Nested Loop Left Join (cost=0.42..519.21 rows=61 width=64) (actual time=0.016..0.238 rows=68 loops=1)

11. 0.013 0.013 ↓ 1.1 68 1

Seq Scan on tracks_to_rightholders rtr (cost=0.00..3.61 rows=61 width=48) (actual time=0.006..0.013 rows=68 loops=1)

12. 0.204 0.204 ↑ 1.0 1 68

Index Scan using items_pkey on items ri (cost=0.42..8.44 rows=1 width=64) (actual time=0.003..0.003 rows=1 loops=68)

  • Index Cond: (rtr.right_id = id)
13. 0.204 0.204 ↑ 1.0 1 68

Index Scan using items_pkey on items ci (cost=0.43..8.45 rows=1 width=32) (actual time=0.003..0.003 rows=1 loops=68)

  • Index Cond: (id = rtr.contract_id)
  • Filter: (org_id = 1)
  • Rows Removed by Filter: 0
14. 0.040 0.040 ↑ 1.0 1 40

Index Scan using types_pkey on contract_kinds tck (cost=0.27..0.29 rows=1 width=32) (actual time=0.001..0.001 rows=1 loops=40)

  • Index Cond: (ci.kind_id = id)
15. 0.033 0.040 ↓ 12.0 12 40

Materialize (cost=0.00..1.01 rows=1 width=48) (actual time=0.000..0.001 rows=12 loops=40)

16. 0.007 0.007 ↓ 12.0 12 1

Seq Scan on contract_types tct (cost=0.00..1.01 rows=1 width=48) (actual time=0.005..0.007 rows=12 loops=1)

17. 0.120 0.120 ↑ 1.0 1 40

Index Scan using items_pkey on items o (cost=0.42..1.31 rows=1 width=37) (actual time=0.003..0.003 rows=1 loops=40)

  • Index Cond: (id = ri.object_id)
18. 0.080 0.080 ↓ 0.0 0 40

Index Only Scan using rights_contract_id_idx on rights cr (cost=0.43..20.43 rows=4 width=16) (actual time=0.002..0.002 rows=0 loops=40)

  • Index Cond: (contract_id = rtr.contract_id)
  • Heap Fetches: 0
19.          

SubPlan (forGroup)

20. 0.040 0.040 ↓ 0.0 0 8

Index Scan using codes_object_id_idx on codes oc (cost=0.43..8.45 rows=1 width=8) (actual time=0.005..0.005 rows=0 loops=8)

  • Index Cond: (object_id = o.id)
  • Filter: (attribute_type_id = 159)
  • Rows Removed by Filter: 1
21. 0.048 0.048 ↑ 1.0 1 8

Seq Scan on roles (cost=0.00..3.53 rows=1 width=4) (actual time=0.006..0.006 rows=1 loops=8)

  • Filter: (id = ri.role_id)
  • Rows Removed by Filter: 39
22. 0.024 0.024 ↓ 0.0 0 8

Index Scan using codes_object_id_idx on codes oc_1 (cost=0.43..8.45 rows=1 width=8) (actual time=0.003..0.003 rows=0 loops=8)

  • Index Cond: (object_id = o.id)
  • Filter: (attribute_type_id = 151)
  • Rows Removed by Filter: 1