explain.depesz.com

PostgreSQL's explain analyze made readable

Result: pUt7

Settings
# exclusive inclusive rows x rows loops node
1. 0.487 5,263.518 ↑ 1.0 20 1

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

2. 0.092 5,263.031 ↑ 8.7 20 1

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

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

Merge Full Join (cost=335,648.85..335,660.88 rows=174 width=544) (actual time=5,257.461..5,262.939 rows=368 loops=1)

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

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

  • Group Key: ws.partner_id, ws.webmaster
5. 6.753 111.458 ↓ 51.1 8,889 1

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

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

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

  • Workers Planned: 2
  • Workers Launched: 2
7. 13.161 102.066 ↓ 41.2 2,963 3

Hash Join (cost=9,887.20..62,934.66 rows=72 width=18) (actual time=41.815..102.066 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. 48.548 63.254 ↑ 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=15.872..63.254 rows=49,383 loops=3)

  • Recheck Cond: ((date >= '2019-01-07'::date) AND (date <= '2019-02-05'::date))
  • Heap Blocks: exact=4505
9. 14.706 14.706 ↓ 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=14.706..14.706 rows=148,150 loops=1)

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

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

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

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

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

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

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

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

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

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

  • Workers Planned: 2
  • Workers Launched: 2
15. 5,117.813 5,135.239 ↓ 51.6 2,891 3

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

16. 10.284 10.284 ↑ 1.2 716 3

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

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

Bitmap Heap Scan on "order" o (cost=259.53..307.60 rows=1 width=15) (actual time=7.032..7.142 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=88621
18. 0.084 6.610 ↓ 0.0 0 2,147

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

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

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

  • Index Cond: (offer_id = webmaster_1.offer_id)