explain.depesz.com

PostgreSQL's explain analyze made readable

Result: WOaq

Settings
# exclusive inclusive rows x rows loops node
1. 4.515 49,711.181 ↑ 38.8 546 1

Sort (cost=599,778.56..599,831.48 rows=21,167 width=208) (actual time=49,711.130..49,711.181 rows=546 loops=1)

  • Sort Key: pt.title, p2.title
  • Sort Method: quicksort Memory: 147kB
2. 1.929 49,706.666 ↑ 38.8 546 1

GroupAggregate (cost=597,411.08..598,257.76 rows=21,167 width=208) (actual time=49,704.415..49,706.666 rows=546 loops=1)

  • Group Key: r.point_id, pt.id, rp.package_id, p2.id
3. 13.358 49,704.737 ↑ 9.0 2,362 1

Sort (cost=597,411.08..597,464.00 rows=21,167 width=125) (actual time=49,704.388..49,704.737 rows=2,362 loops=1)

  • Sort Key: r.point_id, pt.id, rp.package_id, p2.id
  • Sort Method: quicksort Memory: 638kB
4. 10.537 49,691.379 ↑ 9.0 2,362 1

Hash Left Join (cost=1,880.75..595,890.29 rows=21,167 width=125) (actual time=44,867.558..49,691.379 rows=2,362 loops=1)

  • Hash Cond: (rp.package_id = p2.id)
5. 1,851.610 49,664.400 ↑ 9.0 2,362 1

Hash Join (cost=1,777.55..595,496.04 rows=21,167 width=70) (actual time=44,841.531..49,664.400 rows=2,362 loops=1)

  • Hash Cond: (rp.request_id = r.id)
6. 1,849.733 47,796.541 ↓ 1.0 11,852,547 1

Append (cost=0.00..550,467.18 rows=11,477,238 width=29) (actual time=8.706..47,796.541 rows=11,852,547 loops=1)

7. 0.004 0.004 ↓ 0.0 0 1

Seq Scan on req_package2 rp (cost=0.00..0.00 rows=1 width=112) (actual time=0.004..0.004 rows=0 loops=1)

  • Filter: (state = 3)
8. 45,946.804 45,946.804 ↓ 1.0 11,852,547 1

Seq Scan on req_package2_1 rp_1 (cost=0.00..550,467.18 rows=11,477,237 width=29) (actual time=8.702..45,946.804 rows=11,852,547 loops=1)

  • Filter: (state = 3)
  • Rows Removed by Filter: 1530349
9. 0.308 16.249 ↑ 1.8 936 1

Hash (cost=1,756.70..1,756.70 rows=1,668 width=57) (actual time=16.249..16.249 rows=936 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 101kB
10. 1.083 15.941 ↑ 1.8 936 1

Hash Left Join (cost=2.03..1,756.70 rows=1,668 width=57) (actual time=0.066..15.941 rows=936 loops=1)

  • Hash Cond: (r.point_id = pt.id)
11. 14.834 14.834 ↑ 1.8 936 1

Index Scan using test_request_1 on request r (cost=0.42..1,740.01 rows=1,668 width=16) (actual time=0.035..14.834 rows=936 loops=1)

  • Index Cond: ((close_time)::date = '2019-01-06'::date)
12. 0.012 0.024 ↓ 1.4 38 1

Hash (cost=1.27..1.27 rows=27 width=41) (actual time=0.024..0.024 rows=38 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 11kB
13. 0.012 0.012 ↓ 1.4 38 1

Seq Scan on point pt (cost=0.00..1.27 rows=27 width=41) (actual time=0.006..0.012 rows=38 loops=1)

14. 13.498 16.442 ↓ 1.0 2,088 1

Hash (cost=78.09..78.09 rows=2,009 width=55) (actual time=16.442..16.442 rows=2,088 loops=1)

  • Buckets: 4096 (originally 2048) Batches: 1 (originally 1) Memory Usage: 217kB
15. 2.944 2.944 ↓ 1.0 2,088 1

Seq Scan on package2 p2 (cost=0.00..78.09 rows=2,009 width=55) (actual time=0.640..2.944 rows=2,088 loops=1)