explain.depesz.com

PostgreSQL's explain analyze made readable

Result: NjiB

Settings
# exclusive inclusive rows x rows loops node
1. 0.010 1,188.277 ↑ 125.0 8 1

Merge Left Join (cost=260,856.02..260,857.74 rows=1,000 width=40) (actual time=1,188.266..1,188.277 rows=8 loops=1)

  • Merge Cond: ((generate_series('2020-09-01 00:00:00'::timestamp without time zone, '2020-09-08 00:00:00'::timestamp without time zone, '1 day'::interval)) = (date_trunc('day'::text, history_tb.created_at)))
2. 0.006 0.112 ↑ 125.0 8 1

Merge Left Join (cost=32.09..33.13 rows=1,000 width=24) (actual time=0.103..0.112 rows=8 loops=1)

  • Merge Cond: ((generate_series('2020-09-01 00:00:00'::timestamp without time zone, '2020-09-08 00:00:00'::timestamp without time zone, '1 day'::interval)) = (date_trunc('day'::text, likes_tb.created_at)))
3. 0.013 0.073 ↑ 125.0 8 1

Sort (cost=27.65..28.15 rows=1,000 width=16) (actual time=0.071..0.073 rows=8 loops=1)

  • Sort Key: (generate_series('2020-09-01 00:00:00'::timestamp without time zone, '2020-09-08 00:00:00'::timestamp without time zone, '1 day'::interval))
  • Sort Method: quicksort Memory: 25kB
4. 0.015 0.060 ↑ 125.0 8 1

Hash Left Join (cost=12.64..17.68 rows=1,000 width=16) (actual time=0.056..0.060 rows=8 loops=1)

  • Hash Cond: ((generate_series('2020-09-01 00:00:00'::timestamp without time zone, '2020-09-08 00:00:00'::timestamp without time zone, '1 day'::interval)) = anon_2.date)
5. 0.008 0.008 ↑ 125.0 8 1

ProjectSet (cost=0.00..1.50 rows=1,000 width=8) (actual time=0.006..0.008 rows=8 loops=1)

6. 0.000 0.000 ↑ 1.0 1 1

Result (cost=0.00..0.00 rows=1 width=0) (actual time=0.000..0.000 rows=1 loops=1)

7. 0.004 0.037 ↑ 11.2 4 1

Hash (cost=12.48..12.48 rows=45 width=16) (actual time=0.037..0.037 rows=4 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
8. 0.001 0.033 ↑ 11.2 4 1

Subquery Scan on anon_2 (cost=12.19..12.48 rows=45 width=16) (actual time=0.031..0.033 rows=4 loops=1)

9. 0.007 0.032 ↑ 11.2 4 1

HashAggregate (cost=12.19..12.35 rows=45 width=16) (actual time=0.031..0.032 rows=4 loops=1)

  • Group Key: date_trunc('day'::text, impressions_tb.date)
10. 0.025 0.025 ↑ 11.2 4 1

Index Scan using impressions_tb_job_id_idx on impressions_tb (cost=0.09..12.14 rows=45 width=16) (actual time=0.019..0.025 rows=4 loops=1)

  • Index Cond: (job_id = 2,255,869)
11. 0.005 0.033 ↑ 1.0 2 1

GroupAggregate (cost=4.44..4.45 rows=2 width=16) (actual time=0.030..0.033 rows=2 loops=1)

  • Group Key: (date_trunc('day'::text, likes_tb.created_at))
12. 0.010 0.028 ↓ 1.5 3 1

Sort (cost=4.44..4.44 rows=2 width=16) (actual time=0.028..0.028 rows=3 loops=1)

  • Sort Key: (date_trunc('day'::text, likes_tb.created_at))
  • Sort Method: quicksort Memory: 25kB
13. 0.018 0.018 ↓ 1.5 3 1

Index Scan using likes_tb_job_id_idx on likes_tb (cost=0.08..4.43 rows=2 width=16) (actual time=0.015..0.018 rows=3 loops=1)

  • Index Cond: (job_id = 2,255,869)
  • Filter: (NOT pending)
14. 0.050 1,188.155 ↓ 14.5 87 1

WindowAgg (cost=260,823.94..260,824.00 rows=6 width=24) (actual time=1,188.091..1,188.155 rows=87 loops=1)

15. 0.030 1,188.105 ↓ 14.5 87 1

GroupAggregate (cost=260,823.94..260,823.97 rows=6 width=16) (actual time=1,188.075..1,188.105 rows=87 loops=1)

  • Group Key: (date_trunc('day'::text, history_tb.created_at))
16. 0.047 1,188.075 ↓ 14.5 87 1

Sort (cost=260,823.94..260,823.94 rows=6 width=12) (actual time=1,188.069..1,188.075 rows=87 loops=1)

  • Sort Key: (date_trunc('day'::text, history_tb.created_at))
  • Sort Method: quicksort Memory: 29kB
17. 0.094 1,188.028 ↓ 14.5 87 1

Nested Loop (cost=0.09..260,823.92 rows=6 width=12) (actual time=47.544..1,188.028 rows=87 loops=1)

18. 1,187.601 1,187.601 ↓ 7.4 37 1

Seq Scan on job_tb (cost=0.00..260,625.61 rows=5 width=4) (actual time=47.508..1,187.601 rows=37 loops=1)

  • Filter: ((id_in_source)::text = '076f97a61072219299898168d3c4195c'::text)
  • Rows Removed by Filter: 1,582,499
19. 0.333 0.333 ↑ 16.0 2 37

Index Scan using idx_history_job_id on history_tb (cost=0.09..39.57 rows=32 width=16) (actual time=0.006..0.009 rows=2 loops=37)

  • Index Cond: (job_id = job_tb.id)
  • Filter: (count > 0)
  • Rows Removed by Filter: 0