explain.depesz.com

PostgreSQL's explain analyze made readable

Result: m2x

Settings
# exclusive inclusive rows x rows loops node
1. 0.495 5,327.963 ↑ 1.0 20 1

Limit (cost=341,680.49..341,680.54 rows=20 width=92) (actual time=5,327.468..5,327.963 rows=20 loops=1)

2. 0.194 5,327.468 ↑ 101.7 20 1

Sort (cost=341,680.49..341,685.57 rows=2,033 width=92) (actual time=5,327.467..5,327.468 rows=20 loops=1)

  • Sort Key: (count(*)) DESC NULLS LAST
  • Sort Method: top-N heapsort Memory: 26kB
3. 0.344 5,327.274 ↑ 2.4 862 1

Hash Full Join (cost=341,523.50..341,626.39 rows=2,033 width=92) (actual time=5,320.593..5,327.274 rows=862 loops=1)

  • Hash Cond: ((webmaster.partner_id = web_stat.partner_id) AND ((webmaster.webmaster)::text = (web_stat.webmaster)::text))
4. 0.382 5,223.986 ↑ 2.4 862 1

Merge Full Join (cost=277,458.77..277,545.91 rows=2,033 width=78) (actual time=5,217.641..5,223.986 rows=862 loops=1)

  • Merge Cond: ((webmaster.partner_id = "order".partner_id) AND ((webmaster.webmaster)::text = ("order".webmaster)::text))
5. 3.500 23.619 ↑ 2.4 862 1

GroupAggregate (cost=5,767.75..5,819.07 rows=2,033 width=51) (actual time=19.913..23.619 rows=862 loops=1)

  • Group Key: webmaster.partner_id, webmaster.webmaster
6. 2.065 20.119 ↓ 1.0 2,147 1

Sort (cost=5,767.75..5,772.93 rows=2,073 width=22) (actual time=19.893..20.119 rows=2,147 loops=1)

  • Sort Key: webmaster.partner_id, webmaster.webmaster
  • Sort Method: quicksort Memory: 264kB
7. 18.054 18.054 ↓ 1.0 2,147 1

Seq Scan on webmaster (cost=0.00..5,653.55 rows=2,073 width=22) (actual time=0.028..18.054 rows=2,147 loops=1)

  • Filter: ((status)::text = 'blocked'::text)
  • Rows Removed by Filter: 101177
8. 1.923 5,199.985 ↓ 1.3 183 1

GroupAggregate (cost=271,691.02..271,694.17 rows=140 width=27) (actual time=5,197.724..5,199.985 rows=183 loops=1)

  • Group Key: "order".partner_id, "order".webmaster
9. 3.212 5,198.062 ↓ 64.3 9,005 1

Sort (cost=271,691.02..271,691.37 rows=140 width=15) (actual time=5,197.626..5,198.062 rows=9,005 loops=1)

  • Sort Key: "order".partner_id, "order".webmaster
  • Sort Method: quicksort Memory: 866kB
10. 61.775 5,194.850 ↓ 64.3 9,005 1

Gather (cost=1,259.53..271,686.03 rows=140 width=15) (actual time=16.071..5,194.850 rows=9,005 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
11. 5,115.496 5,133.075 ↓ 51.8 3,002 3

Nested Loop (cost=259.53..270,672.03 rows=58 width=15) (actual time=57.153..5,133.075 rows=3,002 loops=3)

12. 10.438 10.438 ↑ 1.2 716 3

Parallel Seq Scan on webmaster webmaster_1 (cost=0.00..4,900.15 rows=864 width=15) (actual time=0.030..10.438 rows=716 loops=3)

  • Filter: ((status)::text = 'blocked'::text)
  • Rows Removed by Filter: 33726
13. 0.535 7.141 ↓ 4.0 4 2,147

Bitmap Heap Scan on "order" (cost=259.53..307.60 rows=1 width=15) (actual time=7.028..7.141 rows=4 loops=2,147)

  • Recheck Cond: (((webmaster)::text = (webmaster_1.webmaster)::text) AND (offer_id = webmaster_1.offer_id))
  • Rows Removed by Index Recheck: 36
  • Filter: ((created_at >= '2019-01-06 00:00:00'::timestamp without time zone) AND (created_at <= '2019-02-04 23:59:59'::timestamp without time zone) AND (webmaster_1.partner_id = partner_id))
  • Rows Removed by Filter: 132
  • Heap Blocks: exact=73168
14. 0.067 6.606 ↓ 0.0 0 2,147

BitmapAnd (cost=259.53..259.53 rows=12 width=0) (actual time=6.606..6.606 rows=0 loops=2,147)

15. 0.222 0.222 ↓ 1.8 2,012 2,147

Bitmap Index Scan on order_webmaster_idx (cost=0.00..19.36 rows=1,120 width=0) (actual time=0.222..0.222 rows=2,012 loops=2,147)

  • Index Cond: ((webmaster)::text = (webmaster_1.webmaster)::text)
16. 6.317 6.317 ↓ 2.4 71,629 2,120

Bitmap Index Scan on order_offer_id_idx (cost=0.00..239.92 rows=30,026 width=0) (actual time=6.317..6.317 rows=71,629 loops=2,120)

  • Index Cond: (offer_id = webmaster_1.offer_id)
17. 0.096 102.944 ↓ 2.1 370 1

Hash (cost=64,062.07..64,062.07 rows=177 width=26) (actual time=102.944..102.944 rows=370 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 32kB
18. 2.521 102.848 ↓ 2.1 370 1

GroupAggregate (cost=64,056.32..64,060.30 rows=177 width=26) (actual time=99.904..102.848 rows=370 loops=1)

  • Group Key: web_stat.partner_id, web_stat.webmaster
19. 6.171 100.327 ↓ 52.3 9,256 1

Sort (cost=64,056.32..64,056.76 rows=177 width=18) (actual time=99.884..100.327 rows=9,256 loops=1)

  • Sort Key: web_stat.partner_id, web_stat.webmaster
  • Sort Method: quicksort Memory: 877kB
20. 4.283 94.156 ↓ 52.3 9,256 1

Gather (cost=10,960.77..64,049.71 rows=177 width=18) (actual time=42.213..94.156 rows=9,256 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
21. 12.991 89.873 ↓ 41.7 3,085 3

Hash Join (cost=9,960.77..63,032.01 rows=74 width=18) (actual time=38.919..89.873 rows=3,085 loops=3)

  • Hash Cond: ((web_stat.offer_id = webmaster_2.offer_id) AND (web_stat.partner_id = webmaster_2.partner_id) AND ((web_stat.webmaster)::text = (webmaster_2.webmaster)::text))
22. 38.568 54.215 ↑ 1.2 51,179 3

Parallel Bitmap Heap Scan on web_stat (cost=4,270.94..56,875.28 rows=59,289 width=18) (actual time=16.034..54.215 rows=51,179 loops=3)

  • Recheck Cond: ((date >= '2019-01-06'::date) AND (date <= '2019-02-04'::date))
  • Heap Blocks: exact=5840
23. 15.647 15.647 ↓ 1.1 153,536 1

Bitmap Index Scan on web_stat_idx (cost=0.00..4,235.37 rows=142,294 width=0) (actual time=15.647..15.647 rows=153,536 loops=1)

  • Index Cond: ((date >= '2019-01-06'::date) AND (date <= '2019-02-04'::date))
24. 0.771 22.667 ↓ 1.0 2,147 3

Hash (cost=5,653.55..5,653.55 rows=2,073 width=15) (actual time=22.667..22.667 rows=2,147 loops=3)

  • Buckets: 4096 Batches: 1 Memory Usage: 129kB
25. 21.896 21.896 ↓ 1.0 2,147 3

Seq Scan on webmaster webmaster_2 (cost=0.00..5,653.55 rows=2,073 width=15) (actual time=0.022..21.896 rows=2,147 loops=3)

  • Filter: ((status)::text = 'blocked'::text)
  • Rows Removed by Filter: 101177