explain.depesz.com

PostgreSQL's explain analyze made readable

Result: o17g

Settings
# exclusive inclusive rows x rows loops node
1. 520.346 21,587.152 ↑ 1.0 1 1

Aggregate (cost=4,134,963.80..4,134,963.81 rows=1 width=8) (actual time=21,587.152..21,587.152 rows=1 loops=1)

2. 17,047.371 21,066.806 ↑ 1.0 8,969,886 1

Sort (cost=4,000,375.25..4,022,806.68 rows=8,972,570 width=320) (actual time=18,571.974..21,066.806 rows=8,969,886 loops=1)

  • Sort Key: det.priority DESC, r.created_date
  • Sort Method: external merge Disk: 1461536kB
3. 533.519 4,019.435 ↑ 1.0 8,969,886 1

Append (cost=1.23..420,922.47 rows=8,972,570 width=320) (actual time=0.043..4,019.435 rows=8,969,886 loops=1)

4. 2,509.486 3,479.235 ↑ 1.0 8,961,426 1

Hash Join (cost=1.23..330,885.84 rows=8,964,110 width=320) (actual time=0.043..3,479.235 rows=8,961,426 loops=1)

  • Hash Cond: (r.restriction_id = det.id)
5. 969.726 969.726 ↑ 1.0 8,961,426 1

Seq Scan on restricted_domain r (cost=0.00..207,628.10 rows=8,964,110 width=57) (actual time=0.010..969.726 rows=8,961,426 loops=1)

6. 0.014 0.023 ↓ 1.5 15 1

Hash (cost=1.10..1.10 rows=10 width=267) (actual time=0.023..0.023 rows=15 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 12kB
7. 0.009 0.009 ↓ 1.5 15 1

Seq Scan on restriction_detail det (cost=0.00..1.10 rows=10 width=267) (actual time=0.005..0.009 rows=15 loops=1)

8. 6.480 6.681 ↑ 1.0 8,460 1

Hash Join (cost=3.41..310.94 rows=8,460 width=361) (actual time=0.082..6.681 rows=8,460 loops=1)

  • Hash Cond: (w.restriction_id = det_1.id)
9. 0.154 0.154 ↑ 1.0 1,692 1

Seq Scan on restricted_word w (cost=0.00..38.92 rows=1,692 width=38) (actual time=0.008..0.154 rows=1,692 loops=1)

10. 0.018 0.047 ↓ 1.5 75 1

Hash (cost=2.79..2.79 rows=50 width=273) (actual time=0.047..0.047 rows=75 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 27kB
11. 0.009 0.029 ↓ 1.5 75 1

Nested Loop (cost=0.00..2.79 rows=50 width=273) (actual time=0.013..0.029 rows=75 loops=1)

12. 0.005 0.005 ↓ 1.5 15 1

Seq Scan on restriction_detail det_1 (cost=0.00..1.10 rows=10 width=267) (actual time=0.005..0.005 rows=15 loops=1)

13. 0.011 0.015 ↑ 1.0 5 15

Materialize (cost=0.00..1.07 rows=5 width=6) (actual time=0.000..0.001 rows=5 loops=15)

14. 0.004 0.004 ↑ 1.0 5 1

Seq Scan on tld t (cost=0.00..1.05 rows=5 width=6) (actual time=0.004..0.004 rows=5 loops=1)

Planning time : 0.648 ms
Execution time : 21,838.929 ms