explain.depesz.com

PostgreSQL's explain analyze made readable

Result: DIWB

Settings
# exclusive inclusive rows x rows loops node
1. 0.039 836.137 ↑ 1.0 15 1

Sort (cost=221,052.53..221,052.57 rows=15 width=137) (actual time=836.136..836.137 rows=15 loops=1)

  • Sort Key: m.enabled DESC, m.name
  • Sort Method: quicksort Memory: 27kB
2. 0.248 836.098 ↑ 1.0 15 1

Hash Right Join (cost=14,715.07..221,052.24 rows=15 width=137) (actual time=23.487..836.098 rows=15 loops=1)

  • Hash Cond: ((dbobjects_meta.name)::text = (m.name)::text)
3. 0.060 835.715 ↑ 1.0 15 1

Nested Loop (cost=14,707.73..220,921.84 rows=15 width=80) (actual time=23.414..835.715 rows=15 loops=1)

4. 0.032 24.530 ↑ 1.0 15 1

Nested Loop (cost=0.56..313.80 rows=15 width=48) (actual time=0.133..24.530 rows=15 loops=1)

5. 0.033 0.033 ↑ 1.0 15 1

Index Only Scan using dbobjects_meta_pkey on dbobjects_meta (cost=0.14..8.36 rows=15 width=19) (actual time=0.004..0.033 rows=15 loops=1)

  • Heap Fetches: 11
6. 0.030 24.465 ↑ 1.0 1 15

Limit (cost=0.42..20.34 rows=1 width=37) (actual time=1.630..1.631 rows=1 loops=15)

7. 24.435 24.435 ↑ 4,114.0 1 15

Index Scan Backward using etl_locks_history_pkey on etl_locks_history (cost=0.42..81,941.75 rows=4,114 width=37) (actual time=1.629..1.629 rows=1 loops=15)

  • Filter: ((("group")::text = 'CONTROLLER'::text) AND ((subject)::text = (dbobjects_meta.name)::text))
  • Rows Removed by Filter: 5335
8. 0.000 811.125 ↑ 1.0 1 15

Aggregate (cost=14,707.17..14,707.18 rows=1 width=48) (actual time=54.075..54.075 rows=1 loops=15)

9.          

Initplan (for Aggregate)

10. 0.315 743.265 ↑ 1.0 1 15

Limit (cost=3,059.49..3,090.08 rows=1 width=8) (actual time=49.550..49.551 rows=1 loops=15)

11. 742.950 742.950 ↑ 30.5 90 15

Index Scan Backward using etl_locks_history_pkey on etl_locks_history etl_locks_history_2 (cost=0.42..83,880.00 rows=2,742 width=8) (actual time=1.959..49.530 rows=90 loops=15)

  • Filter: ((NOT upper_inf(locked)) AND (("group")::text = 'CONTROLLER'::text) AND ((subject)::text = ($2)::text))
  • Rows Removed by Filter: 114789
12. 796.905 806.670 ↑ 10.4 88 15

Bitmap Heap Scan on etl_locks_history etl_locks_history_1 (cost=99.50..11,600.85 rows=914 width=22) (actual time=50.446..53.778 rows=88 loops=15)

  • Recheck Cond: (((subject)::text = (dbobjects_meta.name)::text) AND (("group")::text = 'CONTROLLER'::text))
  • Filter: ((NOT upper_inf(locked)) AND (lid >= $3))
  • Rows Removed by Filter: 6204
  • Heap Blocks: exact=26995
13. 9.765 9.765 ↓ 1.5 6,292 15

Bitmap Index Scan on x2 (cost=0.00..99.27 rows=4,114 width=0) (actual time=0.651..0.651 rows=6,292 loops=15)

  • Index Cond: ((subject)::text = (dbobjects_meta.name)::text)
14. 0.010 0.030 ↑ 1.0 15 1

Hash (cost=7.15..7.15 rows=15 width=20) (actual time=0.030..0.030 rows=15 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
15. 0.020 0.020 ↑ 1.0 15 1

Seq Scan on dbobjects_meta m (cost=0.00..7.15 rows=15 width=20) (actual time=0.005..0.020 rows=15 loops=1)

16.          

SubPlan (for Hash Right Join)

17. 0.105 0.105 ↓ 0.0 0 15

Index Scan using etl_locks_pkey on etl_locks (cost=0.15..8.17 rows=1 width=8) (actual time=0.007..0.007 rows=0 loops=15)

  • Index Cond: ((("group")::text = 'CONTROLLER'::text) AND ((subject)::text = (m.name)::text))
Planning time : 0.719 ms