explain.depesz.com

PostgreSQL's explain analyze made readable

Result: PmRL

Settings
# exclusive inclusive rows x rows loops node
1. 0.005 1,182.385 ↑ 1.0 20 1

Limit (cost=286,475.27..286,475.32 rows=20 width=740) (actual time=1,182.379..1,182.385 rows=20 loops=1)

2. 0.044 1,182.380 ↑ 3,689.6 20 1

Sort (cost=286,475.27..286,659.75 rows=73,791 width=740) (actual time=1,182.378..1,182.380 rows=20 loops=1)

  • Sort Key: (count(*)) DESC NULLS LAST
  • Sort Method: top-N heapsort Memory: 32kB
3. 0.358 1,182.336 ↑ 1,101.4 67 1

Hash Full Join (cost=270,096.69..284,511.72 rows=73,791 width=740) (actual time=1,045.028..1,182.336 rows=67 loops=1)

  • Hash Cond: (("order".partner_id = web_stat.partner_id) AND (("order".webmaster)::text = (web_stat.webmaster)::text) AND ("order".offer_id = web_stat.offer_id))
4. 129.058 1,116.690 ↑ 1,171.3 63 1

GroupAggregate (cost=231,931.86..237,464.30 rows=73,791 width=151) (actual time=979.715..1,116.690 rows=63 loops=1)

  • Group Key: "order".partner_id, "order".webmaster, "order".offer_id
5. 138.998 987.632 ↓ 3.1 263,961 1

Sort (cost=231,931.86..232,143.91 rows=84,822 width=55) (actual time=953.614..987.632 rows=263,961 loops=1)

  • Sort Key: "order".offer_id
  • Sort Method: external merge Disk: 17904kB
6. 740.931 848.634 ↓ 3.1 263,961 1

Bitmap Heap Scan on "order" (cost=21,204.40..222,086.76 rows=84,822 width=55) (actual time=116.998..848.634 rows=263,961 loops=1)

  • Recheck Cond: (((webmaster)::text = '90289'::text) AND (partner_id = 2))
  • Rows Removed by Index Recheck: 653277
  • Heap Blocks: exact=48464 lossy=99456
7. 4.123 107.703 ↓ 0.0 0 1

BitmapAnd (cost=21,204.40..21,204.40 rows=84,822 width=0) (actual time=107.703..107.703 rows=0 loops=1)

8. 35.830 35.830 ↓ 1.0 263,984 1

Bitmap Index Scan on order_webmaster_idx (cost=0.00..5,088.52 rows=263,478 width=0) (actual time=35.830..35.830 rows=263,984 loops=1)

  • Index Cond: ((webmaster)::text = '90289'::text)
9. 67.750 67.750 ↓ 1.0 872,177 1

Bitmap Index Scan on order_partner_id_idx (cost=0.00..16,073.22 rows=869,972 width=0) (actual time=67.750..67.750 rows=872,177 loops=1)

  • Index Cond: (partner_id = 2)
10. 0.022 65.288 ↑ 124.8 67 1

Hash (cost=38,018.51..38,018.51 rows=8,361 width=38) (actual time=65.288..65.288 rows=67 loops=1)

  • Buckets: 16384 Batches: 1 Memory Usage: 133kB
11. 12.114 65.266 ↑ 124.8 67 1

HashAggregate (cost=37,851.29..37,934.90 rows=8,361 width=38) (actual time=65.211..65.266 rows=67 loops=1)

  • Group Key: web_stat.partner_id, web_stat.webmaster, web_stat.offer_id
12. 50.908 53.152 ↓ 2.3 19,334 1

Bitmap Heap Scan on web_stat (cost=350.91..37,702.79 rows=8,486 width=34) (actual time=4.100..53.152 rows=19,334 loops=1)

  • Recheck Cond: ((webmaster)::text = '90289'::text)
  • Filter: (partner_id = 2)
  • Rows Removed by Filter: 16
  • Heap Blocks: exact=13563
13. 2.244 2.244 ↓ 1.0 19,350 1

Bitmap Index Scan on web_stat_webmaster_idx (cost=0.00..348.79 rows=18,714 width=0) (actual time=2.244..2.244 rows=19,350 loops=1)

  • Index Cond: ((webmaster)::text = '90289'::text)