explain.depesz.com

PostgreSQL's explain analyze made readable

Result: rpW2

Settings
# exclusive inclusive rows x rows loops node
1. 0.365 911.345 ↑ 37.5 280 1

GroupAggregate (cost=120,500.42..120,988.12 rows=10,506 width=96) (actual time=910.932..911.345 rows=280 loops=1)

  • Group Key: t.lat, t.lng
2. 1.230 910.980 ↑ 25.9 1,378 1

Sort (cost=120,500.42..120,589.51 rows=35,637 width=95) (actual time=910.921..910.980 rows=1,378 loops=1)

  • Sort Key: t.lat, t.lng
  • Sort Method: quicksort Memory: 177kB
3. 18.366 909.750 ↑ 25.9 1,378 1

Subquery Scan on t (cost=114,865.99..117,806.07 rows=35,637 width=95) (actual time=791.726..909.750 rows=1,378 loops=1)

  • Filter: (t.r <= 5)
  • Rows Removed by Filter: 391693
4. 294.288 891.384 ↓ 3.7 393,071 1

HashAggregate (cost=114,865.99..116,469.67 rows=106,912 width=103) (actual time=791.719..891.384 rows=393,071 loops=1)

  • Group Key: product_location_124.product, (round(product_location_124.latitude, 0)), (round(product_location_124.longitude, 0)), row_number() OVER (?)
5. 159.316 597.096 ↓ 1.0 393,071 1

WindowAgg (cost=101,125.79..110,940.22 rows=392,577 width=103) (actual time=400.569..597.096 rows=393,071 loops=1)

6. 246.024 437.780 ↓ 1.0 393,071 1

Sort (cost=101,125.79..102,107.24 rows=392,577 width=95) (actual time=400.559..437.780 rows=393,071 loops=1)

  • Sort Key: (round(product_location_124.latitude, 0)), (round(product_location_124.longitude, 0))
  • Sort Method: quicksort Memory: 49292kB
7. 191.756 191.756 ↓ 1.0 393,071 1

Index Scan using idx_product_location_124_date on product_location_124 (cost=0.43..64,650.26 rows=392,577 width=95) (actual time=0.037..191.756 rows=393,071 loops=1)

  • Index Cond: (date > (now() - '1 mon'::interval))
Planning time : 0.155 ms