explain.depesz.com

PostgreSQL's explain analyze made readable

Result: WGik

Settings
# exclusive inclusive rows x rows loops node
1. 0.458 5,277.802 ↑ 1.0 20 1

Limit (cost=335,665.51..335,665.56 rows=20 width=544) (actual time=5,277.344..5,277.802 rows=20 loops=1)

2. 0.091 5,277.344 ↑ 8.7 20 1

Sort (cost=335,665.51..335,665.94 rows=174 width=544) (actual time=5,277.343..5,277.344 rows=20 loops=1)

  • Sort Key: (count(*)) DESC NULLS LAST
  • Sort Method: top-N heapsort Memory: 26kB
3. 0.201 5,277.253 ↓ 2.1 368 1

Merge Left Join (cost=335,648.85..335,660.88 rows=174 width=544) (actual time=5,271.897..5,277.253 rows=368 loops=1)

  • Merge Cond: ((ws.partner_id = o.partner_id) AND ((ws.webmaster)::text = (o.webmaster)::text))
4. 2.392 103.848 ↓ 2.1 368 1

GroupAggregate (cost=63,958.54..63,962.45 rows=174 width=26) (actual time=100.743..103.848 rows=368 loops=1)

  • Group Key: ws.partner_id, ws.webmaster
5. 6.359 101.456 ↓ 51.1 8,889 1

Sort (cost=63,958.54..63,958.97 rows=174 width=18) (actual time=100.723..101.456 rows=8,889 loops=1)

  • Sort Key: ws.partner_id, ws.webmaster
  • Sort Method: quicksort Memory: 858kB
6. 3.135 95.097 ↓ 51.1 8,889 1

Gather (cost=10,887.20..63,952.06 rows=174 width=18) (actual time=41.338..95.097 rows=8,889 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
7. 12.207 91.962 ↓ 41.2 2,963 3

Hash Join (cost=9,887.20..62,934.66 rows=72 width=18) (actual time=39.265..91.962 rows=2,963 loops=3)

  • Hash Cond: ((ws.offer_id = webmaster.offer_id) AND (ws.partner_id = webmaster.partner_id) AND ((ws.webmaster)::text = (webmaster.webmaster)::text))
8. 41.706 56.793 ↑ 1.2 49,383 3

Parallel Bitmap Heap Scan on web_stat ws (cost=4,197.37..56,786.11 rows=58,250 width=18) (actual time=16.021..56.793 rows=49,383 loops=3)

  • Recheck Cond: ((date >= '2019-01-07'::date) AND (date <= '2019-02-05'::date))
  • Heap Blocks: exact=5381
9. 15.087 15.087 ↓ 1.1 148,150 1

Bitmap Index Scan on web_stat_idx (cost=0.00..4,162.42 rows=139,799 width=0) (actual time=15.087..15.087 rows=148,150 loops=1)

  • Index Cond: ((date >= '2019-01-07'::date) AND (date <= '2019-02-05'::date))
10. 0.764 22.962 ↓ 1.0 2,147 3

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

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

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

  • Filter: ((status)::text = 'blocked'::text)
  • Rows Removed by Filter: 101177
12. 1.750 5,173.204 ↓ 1.3 180 1

GroupAggregate (cost=271,690.31..271,693.35 rows=135 width=27) (actual time=5,171.149..5,173.204 rows=180 loops=1)

  • Group Key: o.partner_id, o.webmaster
13. 3.387 5,171.454 ↓ 64.3 8,674 1

Sort (cost=271,690.31..271,690.65 rows=135 width=15) (actual time=5,171.065..5,171.454 rows=8,674 loops=1)

  • Sort Key: o.partner_id, o.webmaster
  • Sort Method: quicksort Memory: 846kB
14. 5.734 5,168.067 ↓ 64.3 8,674 1

Gather (cost=1,259.53..271,685.53 rows=135 width=15) (actual time=134.481..5,168.067 rows=8,674 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
15. 5,144.783 5,162.333 ↓ 51.6 2,891 3

Nested Loop (cost=259.53..270,672.03 rows=56 width=15) (actual time=90.859..5,162.333 rows=2,891 loops=3)

16. 10.372 10.372 ↑ 1.2 716 3

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

  • Filter: ((status)::text = 'blocked'::text)
  • Rows Removed by Filter: 33726
17. 0.534 7.178 ↓ 4.0 4 2,147

Bitmap Heap Scan on "order" o (cost=259.53..307.60 rows=1 width=15) (actual time=7.067..7.178 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-07 00:00:00'::timestamp without time zone) AND (created_at <= '2019-02-05 23:59:59'::timestamp without time zone) AND (webmaster_1.partner_id = partner_id))
  • Rows Removed by Filter: 132
  • Heap Blocks: exact=89494 lossy=5637
18. 0.085 6.644 ↓ 0.0 0 2,147

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

19. 0.221 0.221 ↓ 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.221..0.221 rows=2,012 loops=2,147)

  • Index Cond: ((webmaster)::text = (webmaster_1.webmaster)::text)
20. 6.338 6.338 ↓ 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.338..6.338 rows=71,629 loops=2,120)

  • Index Cond: (offer_id = webmaster_1.offer_id)