explain.depesz.com

PostgreSQL's explain analyze made readable

Result: d4A7

Settings
# exclusive inclusive rows x rows loops node
1. 0.354 1,989.468 ↑ 7.0 254 1

Sort (cost=1,073,976.41..1,073,980.87 rows=1,783 width=70) (actual time=1,989.453..1,989.468 rows=254 loops=1)

  • Sort Key: ((timezone(b.show_timezone, h.clock_time))::date), h.clock_order
  • Sort Method: quicksort Memory: 92kB
2. 19.538 1,989.114 ↑ 7.0 254 1

Merge Join (cost=1,492.01..1,073,880.13 rows=1,783 width=70) (actual time=102.955..1,989.114 rows=254 loops=1)

  • Merge Cond: (b.id = h.bid_id)
  • Join Filter: (((timezone(b.show_timezone, h.clock_time))::date >= '2019-03-04'::date) AND ((timezone(b.show_timezone, h.clock_time))::date <= '2019-03-11'::date))
  • Rows Removed by Join Filter: 15784
3. 76.240 76.240 ↑ 1.0 54,177 1

Index Scan using bid_pkey on bid b (cost=0.00..9,056.07 rows=54,201 width=42) (actual time=0.013..76.240 rows=54,177 loops=1)

4. 6.748 10.483 ↑ 1.0 16,043 1

Sort (cost=1,492.01..1,532.11 rows=16,043 width=32) (actual time=8.892..10.483 rows=16,043 loops=1)

  • Sort Key: h.bid_id
  • Sort Method: quicksort Memory: 1638kB
5. 3.735 3.735 ↑ 1.0 16,043 1

Seq Scan on show_report_hours h (cost=0.00..371.43 rows=16,043 width=32) (actual time=0.006..3.735 rows=16,043 loops=1)

6.          

SubPlan (forMerge Join)

7. 0.762 0.762 ↑ 1.0 1 254

Index Scan using contact_pkey on contact (cost=0.00..2.29 rows=1 width=13) (actual time=0.003..0.003 rows=1 loops=254)

  • Index Cond: (id = h.user_id)
8. 0.508 0.508 ↑ 1.0 1 254

Index Scan using contact_pkey on contact (cost=0.00..2.29 rows=1 width=13) (actual time=0.002..0.002 rows=1 loops=254)

  • Index Cond: (id = h.modifier_id)
9. 0.508 1,209.548 ↑ 1.0 1 254

Aggregate (cost=294.56..294.57 rows=1 width=8) (actual time=4.761..4.762 rows=1 loops=254)

10. 1,209.040 1,209.040 ↓ 5.0 5 254

Index Scan using show_report_hours_index on show_report_hours h2 (cost=0.00..294.56 rows=1 width=8) (actual time=4.741..4.760 rows=5 loops=254)

  • Index Cond: (clock_time < h.clock_time)
  • Filter: ((bid_id = h.bid_id) AND (user_id = h.user_id))
  • Rows Removed by Filter: 15909
11. 0.141 671.019 ↑ 1.0 1 141

Aggregate (cost=294.56..294.57 rows=1 width=8) (actual time=4.759..4.759 rows=1 loops=141)

12. 670.878 670.878 ↓ 2.0 2 141

Index Scan using show_report_hours_index on show_report_hours h2 (cost=0.00..294.56 rows=1 width=8) (actual time=4.749..4.758 rows=2 loops=141)

  • Index Cond: (clock_time < h.clock_time)
  • Filter: ((bid_id = h.bid_id) AND (user_id = h.user_id))
  • Rows Removed by Filter: 15907
13. 1.016 1.016 ↑ 1.0 1 254

Index Scan using contact_pkey on contact (cost=0.00..2.29 rows=1 width=1) (actual time=0.004..0.004 rows=1 loops=254)

  • Index Cond: (id = h.user_id)