explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Xx7L

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 6,247.030 ↓ 6.0 6 1

Limit (cost=16,348.71..16,350.66 rows=1 width=564) (actual time=6,247.027..6,247.030 rows=6 loops=1)

2. 0.010 6,247.030 ↓ 6.0 6 1

WindowAgg (cost=16,348.71..16,350.66 rows=1 width=564) (actual time=6,247.026..6,247.030 rows=6 loops=1)

3. 0.007 6,247.020 ↓ 6.0 6 1

Subquery Scan on inner (cost=16,348.71..16,350.64 rows=1 width=556) (actual time=6,247.016..6,247.020 rows=6 loops=1)

  • Filter: (("inner".y_max > '48.9601781234584'::double precision) AND ("inner".y_min < '49.458106449022'::double precision) AND ("inner".x_max > '16.0146331787109'::double precision) AND ("inner".x_min < '17.0446014404297'::double precision))
4. 0.013 6,247.013 ↑ 14.3 6 1

Sort (cost=16,348.71..16,348.92 rows=86 width=564) (actual time=6,247.011..6,247.013 rows=6 loops=1)

  • Sort Key: (COALESCE(_percentile_orders_pocet_celkem_metric_1.kod_top)), (COALESCE(_percentile_orders_pocet_celkem_metric_1.x_min)), (COALESCE(_percentile_orders_pocet_celkem_metric_1.x_max)), (COALESCE(_percentile_orders_pocet_celkem_metric_1.y_min)), (COALESCE(_percentile_orders_pocet_celkem_metric_1.y_max)), _percentile_orders_pocet_celkem_metric_1._percentile_orders_pocet_celkem_metric_1
  • Sort Method: quicksort Memory: 25kB
5.          

CTE _percentile_orders_pocet_celkem_metric_1

6. 1.828 6,246.966 ↑ 14.3 6 1

GroupAggregate (cost=16,337.36..16,339.74 rows=86 width=48) (actual time=6,244.813..6,246.966 rows=6 loops=1)

  • Group Key: mestske_casti_dwh.kod_top, mestske_casti_dwh.x_min, mestske_casti_dwh.x_max, mestske_casti_dwh.y_min, mestske_casti_dwh.y_max
7. 6.107 6,245.138 ↓ 61.3 5,336 1

Sort (cost=16,337.36..16,337.58 rows=87 width=51) (actual time=6,244.392..6,245.138 rows=5,336 loops=1)

  • Sort Key: mestske_casti_dwh.kod_top, mestske_casti_dwh.x_min, mestske_casti_dwh.x_max, mestske_casti_dwh.y_min, mestske_casti_dwh.y_max
  • Sort Method: quicksort Memory: 943kB
8. 0.000 6,239.031 ↓ 61.3 5,336 1

Nested Loop (cost=1,004.65..16,334.56 rows=87 width=51) (actual time=0.863..6,239.031 rows=5,336 loops=1)

9. 0.018 0.018 ↑ 1.0 1 1

Index Only Scan using index_restaurant_dwh_restaurant_id on restaurant_dwh (cost=0.28..4.30 rows=1 width=5) (actual time=0.016..0.018 rows=1 loops=1)

  • Index Cond: (restaurant_id = '6381'::text)
  • Heap Fetches: 0
10. 33.906 6,252.854 ↓ 61.3 5,336 1

Gather (cost=1,004.37..16,329.39 rows=87 width=56) (actual time=0.844..6,252.854 rows=5,336 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
11. 6,205.309 6,218.948 ↓ 49.4 1,779 3

Nested Loop (cost=4.37..15,320.69 rows=36 width=56) (actual time=154.066..6,218.948 rows=1,779 loops=3)

12. 5.569 8.410 ↓ 8.9 1,187 3

Hash Join (cost=3.93..555.77 rows=133 width=48) (actual time=0.195..8.410 rows=1,187 loops=3)

  • Hash Cond: ((zsj_d_dwh.kod_top)::text = (mestske_casti_dwh.kod_top)::text)
13. 2.779 2.779 ↑ 1.2 7,768 3

Parallel Seq Scan on zsj_d_dwh (cost=0.00..514.10 rows=9,710 width=15) (actual time=0.016..2.779 rows=7,768 loops=3)

14. 0.027 0.062 ↑ 1.0 86 3

Hash (cost=2.86..2.86 rows=86 width=40) (actual time=0.062..0.062 rows=86 loops=3)

  • Buckets: 1024 Batches: 1 Memory Usage: 15kB
15. 0.035 0.035 ↑ 1.0 86 3

Seq Scan on mestske_casti_dwh (cost=0.00..2.86 rows=86 width=40) (actual time=0.009..0.035 rows=86 loops=3)

16. 5.229 5.229 ↑ 2.0 1 3,561

Index Scan using index_orders_dwh_kod_zsj_d on orders_dwh (cost=0.43..110.99 rows=2 width=24) (actual time=4.614..5.229 rows=1 loops=3,561)

  • Index Cond: ((kod_zsj_d)::text = (zsj_d_dwh.kod_zsj_d)::text)
  • Filter: ((datum >= '2018-09-01'::date) AND (datum <= '2018-11-16'::date) AND (hour_id >= 0) AND (hour_id <= 23) AND ((restaurant_id)::text = '6381'::text))
  • Rows Removed by Filter: 1640
17. 0.021 6,247.000 ↑ 14.3 6 1

WindowAgg (cost=4.48..6.20 rows=86 width=564) (actual time=6,246.992..6,247.000 rows=6 loops=1)

18. 0.005 6,246.979 ↑ 14.3 6 1

Sort (cost=4.48..4.70 rows=86 width=556) (actual time=6,246.979..6,246.979 rows=6 loops=1)

  • Sort Key: _percentile_orders_pocet_celkem_metric_1._percentile_orders_pocet_celkem_metric_1 NULLS FIRST
  • Sort Method: quicksort Memory: 25kB
19. 6,246.974 6,246.974 ↑ 14.3 6 1

CTE Scan on _percentile_orders_pocet_celkem_metric_1 (cost=0.00..1.72 rows=86 width=556) (actual time=6,244.816..6,246.974 rows=6 loops=1)