explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 4NG9

Settings
# exclusive inclusive rows x rows loops node
1. 0.090 267.967 ↑ 6.6 998 1

Limit (cost=55,157.44..55,173.85 rows=6,561 width=1,274) (actual time=267.443..267.967 rows=998 loops=1)

2. 2.411 267.877 ↑ 6.6 998 1

Sort (cost=55,157.44..55,173.85 rows=6,561 width=1,274) (actual time=267.442..267.877 rows=998 loops=1)

  • Sort Key: d.partition_id
  • Sort Method: quicksort Memory: 1617kB
3. 1.187 265.466 ↑ 6.6 998 1

Hash Join (cost=705.62..54,741.49 rows=6,561 width=1,274) (actual time=167.240..265.466 rows=998 loops=1)

  • Hash Cond: (d.topic_id = t.id)
4. 0.194 256.204 ↑ 6.6 998 1

Nested Loop (cost=0.00..53,945.65 rows=6,561 width=126) (actual time=159.061..256.204 rows=998 loops=1)

5. 2.071 2.071 ↑ 1.0 1 1

Seq Scan on partition p (cost=0.00..394.73 rows=1 width=61) (actual time=1.705..2.071 rows=1 loops=1)

  • Filter: (((vin)::text = '5G21A6P06L4100012'::text) AND (((bag_date)::text = to_char('2019-05-01 10:13:08'::timestamp without time zone, 'YYYYMMDD'::text)) OR ((bag_date)::text = to_char('2019-05-02 10:13:08'::timestamp without time zone, 'YYYYMMDD'::text))))
  • Rows Removed by Filter: 7839
6. 0.108 253.939 ↑ 55.7 998 1

Append (cost=0.00..52,995.10 rows=55,582 width=73) (actual time=157.344..253.939 rows=998 loops=1)

7. 0.005 0.005 ↓ 0.0 0 1

Seq Scan on data d (cost=0.00..0.00 rows=1 width=73) (actual time=0.005..0.005 rows=0 loops=1)

  • Filter: ((start_time <= '2019-05-02 10:13:18'::timestamp without time zone) AND (end_time >= '2019-05-02 10:13:08'::timestamp without time zone) AND (p.id = partition_id))
8. 0.011 0.011 ↓ 0.0 0 1

Index Scan using end_index_2019_02 on data_2019_02 d_1 (cost=0.56..8.42 rows=1 width=73) (actual time=0.011..0.011 rows=0 loops=1)

  • Index Cond: (end_time >= '2019-05-02 10:13:08'::timestamp without time zone)
  • Filter: ((start_time <= '2019-05-02 10:13:18'::timestamp without time zone) AND (p.id = partition_id))
9. 0.010 0.010 ↓ 0.0 0 1

Index Scan using end_index_2019_03 on data_2019_03 d_2 (cost=0.57..4.73 rows=1 width=73) (actual time=0.010..0.010 rows=0 loops=1)

  • Index Cond: (end_time >= '2019-05-02 10:13:08'::timestamp without time zone)
  • Filter: ((start_time <= '2019-05-02 10:13:18'::timestamp without time zone) AND (p.id = partition_id))
10. 0.005 0.005 ↓ 0.0 0 1

Index Scan using end_index_2019_01 on data_2019_01 d_3 (cost=0.42..8.43 rows=1 width=73) (actual time=0.005..0.005 rows=0 loops=1)

  • Index Cond: (end_time >= '2019-05-02 10:13:08'::timestamp without time zone)
  • Filter: ((start_time <= '2019-05-02 10:13:18'::timestamp without time zone) AND (p.id = partition_id))
11. 0.005 0.005 ↓ 0.0 0 1

Index Scan using end_index_2018_12 on data_2018_12 d_4 (cost=0.29..8.31 rows=1 width=73) (actual time=0.005..0.005 rows=0 loops=1)

  • Index Cond: (end_time >= '2019-05-02 10:13:08'::timestamp without time zone)
  • Filter: ((start_time <= '2019-05-02 10:13:18'::timestamp without time zone) AND (p.id = partition_id))
12. 0.007 0.007 ↓ 0.0 0 1

Index Scan using end_index_2018_11 on data_2018_11 d_5 (cost=0.28..8.30 rows=1 width=73) (actual time=0.007..0.007 rows=0 loops=1)

  • Index Cond: (end_time >= '2019-05-02 10:13:08'::timestamp without time zone)
  • Filter: ((start_time <= '2019-05-02 10:13:18'::timestamp without time zone) AND (p.id = partition_id))
13. 0.003 0.003 ↓ 0.0 0 1

Index Scan using end_index_2018_10 on data_2018_10 d_6 (cost=0.29..8.30 rows=1 width=73) (actual time=0.003..0.003 rows=0 loops=1)

  • Index Cond: (end_time >= '2019-05-02 10:13:08'::timestamp without time zone)
  • Filter: ((start_time <= '2019-05-02 10:13:18'::timestamp without time zone) AND (p.id = partition_id))
14. 0.009 0.009 ↓ 0.0 0 1

Index Scan using end_index_2019_04 on data_2019_04 d_7 (cost=0.57..4.60 rows=1 width=73) (actual time=0.009..0.009 rows=0 loops=1)

  • Index Cond: (end_time >= '2019-05-02 10:13:08'::timestamp without time zone)
  • Filter: ((start_time <= '2019-05-02 10:13:18'::timestamp without time zone) AND (p.id = partition_id))
15. 253.767 253.767 ↑ 55.7 998 1

Index Scan using part_idx_2019_05 on data_2019_05 d_8 (cost=0.57..52,937.72 rows=55,573 width=73) (actual time=157.282..253.767 rows=998 loops=1)

  • Index Cond: (partition_id = p.id)
  • Filter: ((start_time <= '2019-05-02 10:13:18'::timestamp without time zone) AND (end_time >= '2019-05-02 10:13:08'::timestamp without time zone))
  • Rows Removed by Filter: 744353
16. 0.009 0.009 ↓ 0.0 0 1

Index Scan using end_index_2018_08 on data_2018_08 d_9 (cost=0.28..6.30 rows=1 width=73) (actual time=0.008..0.009 rows=0 loops=1)

  • Index Cond: (end_time >= '2019-05-02 10:13:08'::timestamp without time zone)
  • Filter: ((start_time <= '2019-05-02 10:13:18'::timestamp without time zone) AND (p.id = partition_id))
17. 4.794 8.075 ↓ 1.0 2,645 1

Hash (cost=673.61..673.61 rows=2,561 width=1,164) (actual time=8.075..8.075 rows=2,645 loops=1)

  • Buckets: 4096 Batches: 1 Memory Usage: 3134kB
18. 3.281 3.281 ↓ 1.0 2,645 1

Seq Scan on topic t (cost=0.00..673.61 rows=2,561 width=1,164) (actual time=0.015..3.281 rows=2,645 loops=1)