explain.depesz.com

PostgreSQL's explain analyze made readable

Result: X0r

Settings
# exclusive inclusive rows x rows loops node
1. 1,070.196 16,925.965 ↑ 1.6 304,828 1

HashAggregate (cost=16,749,234.74..16,756,330.49 rows=473,050 width=20) (actual time=16,865.365..16,925.965 rows=304,828 loops=1)

  • Group Key: date_trunc('month'::text, (aal.date)::timestamp with time zone), aal.supplier_employee_id, aal.lot_id, aal.supplier_practice_id
2. 2,155.012 15,855.769 ↓ 1.1 2,793,830 1

Nested Loop Left Join (cost=6.31..16,722,950.09 rows=2,628,465 width=20) (actual time=0.051..15,855.769 rows=2,793,830 loops=1)

3. 2,525.437 2,525.437 ↓ 1.1 2,793,830 1

Index Scan using account_analytic_line_is_timesheet_index on account_analytic_line aal (cost=0.43..1,205,750.40 rows=2,628,465 width=16) (actual time=0.019..2,525.437 rows=2,793,830 loops=1)

  • Index Cond: (is_timesheet = true)
  • Filter: (is_timesheet AND (unit_amount <> '0'::double precision) AND ((line_type)::text = 'standard'::text))
  • Rows Removed by Filter: 861954
4. 0.000 11,175.320 ↑ 1.0 1 2,793,830

Limit (cost=5.87..5.88 rows=1 width=8) (actual time=0.004..0.004 rows=1 loops=2,793,830)

5. 2,793.830 11,175.320 ↑ 1.0 1 2,793,830

Sort (cost=5.87..5.88 rows=1 width=8) (actual time=0.004..0.004 rows=1 loops=2,793,830)

  • Sort Key: hr_contract_line.effective_date DESC
  • Sort Method: top-N heapsort Memory: 25kB
6. 8,381.490 8,381.490 ↓ 3.0 3 2,793,830

Index Scan using hr_contract_line_employee_id_index on hr_contract_line (cost=0.29..5.86 rows=1 width=8) (actual time=0.002..0.003 rows=3 loops=2,793,830)

  • Index Cond: (employee_id = aal.supplier_employee_id)
  • Filter: (effective_date <= aal.date)
  • Rows Removed by Filter: 2
Planning time : 0.716 ms
Execution time : 16,936.192 ms