explain.depesz.com

PostgreSQL's explain analyze made readable

Result: WGjY

Settings
# exclusive inclusive rows x rows loops node
1. 0.004 1,470.033 ↑ 1.0 20 1

Limit (cost=426,132.71..426,132.76 rows=20 width=84) (actual time=1,470.029..1,470.033 rows=20 loops=1)

2. 13.844 1,470.029 ↑ 9,888.0 20 1

Sort (cost=426,132.71..426,627.11 rows=197,761 width=84) (actual time=1,470.028..1,470.029 rows=20 loops=1)

  • Sort Key: (string_agg(DISTINCT (webmaster.status)::text, ','::text)) DESC NULLS LAST
  • Sort Method: top-N heapsort Memory: 26kB
3. 19.697 1,456.185 ↑ 3.4 58,538 1

Merge Left Join (cost=407,944.69..420,870.36 rows=197,761 width=84) (actual time=1,154.665..1,456.185 rows=58,538 loops=1)

  • Merge Cond: ((webmaster.partner_id = web_stat.partner_id) AND ((webmaster.webmaster)::text = (web_stat.webmaster)::text))
4. 17.956 1,014.953 ↑ 1.2 58,538 1

Merge Left Join (cost=335,212.53..341,592.04 rows=70,847 width=62) (actual time=789.751..1,014.953 rows=58,538 loops=1)

  • Merge Cond: ((webmaster.partner_id = "order".partner_id) AND ((webmaster.webmaster)::text = ("order".webmaster)::text))
5. 143.974 386.549 ↓ 1.7 58,538 1

GroupAggregate (cost=16,138.89..17,577.45 rows=35,082 width=43) (actual time=218.376..386.549 rows=58,538 loops=1)

  • Group Key: webmaster.partner_id, webmaster.webmaster
6. 214.283 242.575 ↑ 1.0 99,955 1

Sort (cost=16,138.89..16,388.90 rows=100,004 width=18) (actual time=218.340..242.575 rows=99,955 loops=1)

  • Sort Key: webmaster.partner_id, webmaster.webmaster
  • Sort Method: external merge Disk: 2784kB
7. 28.292 28.292 ↑ 1.0 99,955 1

Seq Scan on webmaster (cost=0.00..5,782.70 rows=100,004 width=18) (actual time=0.012..28.292 rows=99,955 loops=1)

  • Filter: ((status)::text = ANY ('{active,pessimised,blocked}'::text[]))
  • Rows Removed by Filter: 3369
8. 17.044 610.448 ↑ 40.9 1,975 1

GroupAggregate (cost=319,073.64..321,568.20 rows=80,779 width=19) (actual time=571.371..610.448 rows=1,975 loops=1)

  • Group Key: "order".partner_id, "order".webmaster
9. 253.873 593.404 ↑ 1.2 136,432 1

Sort (cost=319,073.64..319,495.34 rows=168,677 width=11) (actual time=571.363..593.404 rows=136,432 loops=1)

  • Sort Key: "order".partner_id, "order".webmaster
  • Sort Method: external merge Disk: 4832kB
10. 322.924 339.531 ↓ 1.1 186,698 1

Bitmap Heap Scan on "order" (cost=3,581.37..301,545.19 rows=168,677 width=11) (actual time=22.715..339.531 rows=186,698 loops=1)

  • Recheck Cond: ((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))
  • Rows Removed by Index Recheck: 145717
  • Heap Blocks: exact=40843 lossy=33942
11. 16.607 16.607 ↓ 1.1 186,698 1

Bitmap Index Scan on order_created_at_idx (cost=0.00..3,539.20 rows=168,677 width=0) (actual time=16.607..16.607 rows=186,698 loops=1)

  • Index Cond: ((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))
12. 22.708 421.535 ↑ 13.2 8,459 1

GroupAggregate (cost=72,732.16..75,271.65 rows=111,655 width=18) (actual time=364.909..421.535 rows=8,459 loops=1)

  • Group Key: web_stat.partner_id, web_stat.webmaster
13. 292.733 398.827 ↓ 1.1 153,536 1

Sort (cost=72,732.16..73,087.90 rows=142,294 width=14) (actual time=364.897..398.827 rows=153,536 loops=1)

  • Sort Key: web_stat.partner_id, web_stat.webmaster
  • Sort Method: external merge Disk: 3256kB
14. 96.230 106.094 ↓ 1.1 153,536 1

Bitmap Heap Scan on web_stat (cost=4,270.94..58,120.35 rows=142,294 width=14) (actual time=12.043..106.094 rows=153,536 loops=1)

  • Recheck Cond: ((date >= '2019-01-06'::date) AND (date <= '2019-02-04'::date))
  • Heap Blocks: exact=16613
15. 9.864 9.864 ↓ 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=9.864..9.864 rows=153,536 loops=1)

  • Index Cond: ((date >= '2019-01-06'::date) AND (date <= '2019-02-04'::date))