explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 4dAJ

Settings
# exclusive inclusive rows x rows loops node
1. 1.977 3.007 ↓ 0.0 0 1

Hash Join (cost=190,678.40..302,867.61 rows=132,491 width=20) (actual time=3.007..3.007 rows=0 loops=1)

  • Hash Cond: (ts.line_id = aal.id)
2.          

Initplan (forHash Join)

3. 0.000 0.000 ↓ 0.0 0

Seq Scan on hr_period (cost=0.00..19.50 rows=42 width=4) (never executed)

  • Filter: ((start_date <= (now())::date) AND (end_date >= (now())::date))
4. 0.000 0.000 ↓ 0.0 0

Seq Scan on hr_period hr_period_1 (cost=0.00..19.50 rows=42 width=4) (never executed)

  • Filter: ((start_date <= (now())::date) AND (end_date >= (now())::date))
5. 0.006 0.294 ↑ 1.0 1 1

Limit (cost=8.18..8.19 rows=1 width=4) (actual time=0.292..0.294 rows=1 loops=1)

6. 0.160 0.288 ↑ 1.0 1 1

Sort (cost=8.18..8.19 rows=1 width=4) (actual time=0.288..0.288 rows=1 loops=1)

  • Sort Key: hr_week_number.date_start
  • Sort Method: top-N heapsort Memory: 25kB
7. 0.128 0.128 ↓ 35.0 35 1

Index Scan using idx_week_number_validation_date on hr_week_number (cost=0.15..8.17 rows=1 width=4) (actual time=0.051..0.128 rows=35 loops=1)

  • Index Cond: (validation_date > (now())::date)
8. 0.017 0.017 ↑ 3,567,810.0 1 1

Seq Scan on hr_analytic_timesheet ts (cost=0.00..96,160.10 rows=3,567,810 width=8) (actual time=0.017..0.017 rows=1 loops=1)

9. 0.003 0.719 ↓ 0.0 0 1

Hash (cost=188,211.45..188,211.45 rows=193,581 width=20) (actual time=0.719..0.719 rows=0 loops=1)

  • Buckets: 262144 Batches: 1 Memory Usage: 2048kB
10. 0.022 0.716 ↓ 0.0 0 1

Hash Join (cost=65.30..188,211.45 rows=193,581 width=20) (actual time=0.716..0.716 rows=0 loops=1)

  • Hash Cond: (aal.product_id = (COALESCE(wrat.second_timesheet_product_id, wrat.default_product_id)))
11. 0.357 0.357 ↑ 868,813.5 2 1

Index Scan using account_analytic_line_date_index on account_analytic_line aal (cost=0.43..94,985.35 rows=1,737,627 width=20) (actual time=0.344..0.357 rows=2 loops=1)

  • Index Cond: (date >= $2)
12. 0.020 0.337 ↑ 79.2 5 1

Hash (cost=59.92..59.92 rows=396 width=8) (actual time=0.337..0.337 rows=5 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
13. 0.032 0.317 ↑ 79.2 5 1

HashAggregate (cost=52.00..55.96 rows=396 width=12) (actual time=0.308..0.317 rows=5 loops=1)

  • Group Key: atc_rel.hct_id, COALESCE(wrat.second_timesheet_product_id, wrat.default_product_id)
14. 0.046 0.285 ↑ 66.0 6 1

Hash Join (cost=4.99..50.02 rows=396 width=12) (actual time=0.260..0.285 rows=6 loops=1)

  • Hash Cond: (atc_rel.wrat_id = wrat.id)
15. 0.021 0.021 ↑ 376.7 6 1

Seq Scan on hr_week_act_type_hol_count_type_rel atc_rel (cost=0.00..32.60 rows=2,260 width=8) (actual time=0.012..0.021 rows=6 loops=1)

16. 0.072 0.218 ↑ 1.0 35 1

Hash (cost=4.55..4.55 rows=35 width=12) (actual time=0.218..0.218 rows=35 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
17. 0.146 0.146 ↑ 1.0 35 1

Seq Scan on hr_weekly_report_activity_type wrat (cost=0.00..4.55 rows=35 width=12) (actual time=0.019..0.146 rows=35 loops=1)

  • Filter: ((line_type)::text = 'absence'::text)
  • Rows Removed by Filter: 89
Planning time : 6.453 ms
Execution time : 3.857 ms