#1 | Append | |
#2 | ├ Index Scan | |
#3 | ├ Index Scan | |
#4 | ├ Index Scan | |
#5 | ├ Index Scan | |
#6 | ├ Index Scan | |
#7 | ├ Index Scan | |
#8 | ├ Index Scan | |
#9 | ├ Index Scan | |
#10 | ├ Index Scan | |
#11 | ├ Index Scan | |
#12 | ├ Index Scan | |
#13 | ├ Index Scan | |
#14 | ├ Index Scan | |
#15 | ├ Index Scan | |
#16 | └ Index Scan |
QUERY PLAN
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Append (cost=0.43..394.00 rows=115 width=34) (actual time=3.842..19.125 rows=41 loops=1)
-> Index Scan using entries_p2022_05_30_person_id_cd_ct_idx on entries_p2022_05_30 (cost=0.43..8.46 rows=1 width=41) (actual time=1.511..1.511 rows=0 loops=1)
Index Cond: ((person_id = '111111'::bigint) AND (created_at_date >= '2022-06-01'::date) AND (created_at_date <= '2022-06-26'::date) AND (created_at_time >= '08:00:00'::time without time zone) AND (created_at_time <= '20:00:00'::time without time zone))
-> Index Scan using entries_p2022_05_31_person_id_cd_ct_idx on entries_p2022_05_31 (cost=0.43..8.46 rows=1 width=38) (actual time=1.172..1.172 rows=0 loops=1)
Index Cond: ((person_id = '111111'::bigint) AND (created_at_date >= '2022-06-01'::date) AND (created_at_date <= '2022-06-26'::date) AND (created_at_time >= '08:00:00'::time without time zone) AND (created_at_time <= '20:00:00'::time without time zone))
-> Index Scan using entries_p2022_06_01_person_id_cd_ct_idx on entries_p2022_06_01 (cost=0.43..80.34 rows=26 width=32) (actual time=1.157..1.194 rows=10 loops=1)
Index Cond: ((person_id = '111111'::bigint) AND (created_at_date >= '2022-06-01'::date) AND (created_at_date <= '2022-06-26'::date) AND (created_at_time >= '08:00:00'::time without time zone) AND (created_at_time <= '20:00:00'::time without time zone))
-> Index Scan using entries_p2022_06_02_person_id_cd_ct_idx on entries_p2022_06_02 (cost=0.43..101.82 rows=51 width=32) (actual time=1.285..2.095 rows=12 loops=1)
Index Cond: ((person_id = '111111'::bigint) AND (created_at_date >= '2022-06-01'::date) AND (created_at_date <= '2022-06-26'::date) AND (created_at_time >= '08:00:00'::time without time zone) AND (created_at_time <= '20:00:00'::time without time zone))
-> Index Scan using entries_p2022_06_03_person_id_cd_ct_idx on entries_p2022_06_03 (cost=0.43..40.94 rows=9 width=32) (actual time=0.631..1.552 rows=4 loops=1)
Index Cond: ((person_id = '111111'::bigint) AND (created_at_date >= '2022-06-01'::date) AND (created_at_date <= '2022-06-26'::date) AND (created_at_time >= '08:00:00'::time without time zone) AND (created_at_time <= '20:00:00'::time without time zone))
-> Index Scan using entries_p2022_06_04_person_id_cd_ct_idx on entries_p2022_06_04 (cost=0.43..41.01 rows=9 width=32) (actual time=1.142..2.772 rows=6 loops=1)
Index Cond: ((person_id = '111111'::bigint) AND (created_at_date >= '2022-06-01'::date) AND (created_at_date <= '2022-06-26'::date) AND (created_at_time >= '08:00:00'::time without time zone) AND (created_at_time <= '20:00:00'::time without time zone))
-> Index Scan using entries_p2022_06_05_person_id_cd_ct_idx on entries_p2022_06_05 (cost=0.43..45.03 rows=10 width=32) (actual time=1.359..4.725 rows=9 loops=1)
Index Cond: ((person_id = '111111'::bigint) AND (created_at_date >= '2022-06-01'::date) AND (created_at_date <= '2022-06-26'::date) AND (created_at_time >= '08:00:00'::time without time zone) AND (created_at_time <= '20:00:00'::time without time zone))
-> Index Scan using entries_p2022_06_06_person_id_cd_ct_idx on entries_p2022_06_06 (cost=0.43..8.46 rows=1 width=32) (actual time=0.434..0.435 rows=0 loops=1)
Index Cond: ((person_id = '111111'::bigint) AND (created_at_date >= '2022-06-01'::date) AND (created_at_date <= '2022-06-26'::date) AND (created_at_time >= '08:00:00'::time without time zone) AND (created_at_time <= '20:00:00'::time without time zone))
-> Index Scan using entries_p2022_06_07_person_id_cd_ct_idx on entries_p2022_06_07 (cost=0.43..8.46 rows=1 width=35) (actual time=0.392..0.393 rows=0 loops=1)
Index Cond: ((person_id = '111111'::bigint) AND (created_at_date >= '2022-06-01'::date) AND (created_at_date <= '2022-06-26'::date) AND (created_at_time >= '08:00:00'::time without time zone) AND (created_at_time <= '20:00:00'::time without time zone))
-> Index Scan using entries_p2022_06_08_person_id_cd_ct_idx on entries_p2022_06_08 (cost=0.43..8.46 rows=1 width=38) (actual time=0.398..0.399 rows=0 loops=1)
Index Cond: ((person_id = '111111'::bigint) AND (created_at_date >= '2022-06-01'::date) AND (created_at_date <= '2022-06-26'::date) AND (created_at_time >= '08:00:00'::time without time zone) AND (created_at_time <= '20:00:00'::time without time zone))
-> Index Scan using entries_p2022_06_09_person_id_cd_ct_idx on entries_p2022_06_09 (cost=0.43..8.46 rows=1 width=41) (actual time=0.333..0.333 rows=0 loops=1)
Index Cond: ((person_id = '111111'::bigint) AND (created_at_date >= '2022-06-01'::date) AND (created_at_date <= '2022-06-26'::date) AND (created_at_time >= '08:00:00'::time without time zone) AND (created_at_time <= '20:00:00'::time without time zone))
-> Index Scan using entries_p2022_06_10_person_id_cd_ct_idx on entries_p2022_06_10 (cost=0.43..8.46 rows=1 width=44) (actual time=0.794..0.794 rows=0 loops=1)
Index Cond: ((person_id = '111111'::bigint) AND (created_at_date >= '2022-06-01'::date) AND (created_at_date <= '2022-06-26'::date) AND (created_at_time >= '08:00:00'::time without time zone) AND (created_at_time <= '20:00:00'::time without time zone))
-> Index Scan using entries_p2022_06_11_person_id_cd_ct_idx on entries_p2022_06_11 (cost=0.43..8.46 rows=1 width=47) (actual time=0.687..0.687 rows=0 loops=1)
Index Cond: ((person_id = '111111'::bigint) AND (created_at_date >= '2022-06-01'::date) AND (created_at_date <= '2022-06-26'::date) AND (created_at_time >= '08:00:00'::time without time zone) AND (created_at_time <= '20:00:00'::time without time zone))
-> Index Scan using entries_p2022_06_12_person_id_cd_ct_idx on entries_p2022_06_12 (cost=0.43..8.46 rows=1 width=50) (actual time=1.003..1.004 rows=0 loops=1)
Index Cond: ((person_id = '111111'::bigint) AND (created_at_date >= '2022-06-01'::date) AND (created_at_date <= '2022-06-26'::date) AND (created_at_time >= '08:00:00'::time without time zone) AND (created_at_time <= '20:00:00'::time without time zone))
-> Index Scan using entries_default_driver_id_tsrange_idx on entries_default (cost=0.14..8.16 rows=1 width=154) (actual time=0.032..0.032 rows=0 loops=1)
Index Cond: (person_id = '111111'::bigint)
Filter: ((created_at_date >= '2022-06-01'::date) AND (created_at_date <= '2022-06-26'::date) AND (created_at_time >= '08:00:00'::time without time zone) AND (created_at_time <= '20:00:00'::time without time zone))
Planning Time: 1.141 ms
Execution Time: 19.258 ms
(34 rows)
SELECT *
FROM entries
WHERE person_id = '111111'
AND created_at_date >= '2022-06-01'
AND created_at_date <= '2022-06-05'
AND created_at_time >= '08:00:00'
AND created_at_time <= '20:00:00';
Table | Count | Time | |
---|---|---|---|
entries_p2022_06_05 | 1 | 4.72ms | 25% |
#8 Index Scan | 4.72ms | 25% | |
entries_p2022_06_04 | 1 | 2.77ms | 14% |
#7 Index Scan | 2.77ms | 14% | |
entries_p2022_06_02 | 1 | 2.1ms | 11% |
#5 Index Scan | 2.1ms | 11% | |
entries_p2022_06_03 | 1 | 1.55ms | 8% |
#6 Index Scan | 1.55ms | 8% | |
entries_p2022_05_30 | 1 | 1.51ms | 8% |
#2 Index Scan | 1.51ms | 8% | |
entries_p2022_06_01 | 1 | 1.19ms | 6% |
#4 Index Scan | 1.19ms | 6% | |
entries_p2022_05_31 | 1 | 1.17ms | 6% |
#3 Index Scan | 1.17ms | 6% | |
entries_p2022_06_12 | 1 | 1ms | 5% |
#15 Index Scan | 1ms | 5% | |
entries_p2022_06_10 | 1 | 0.794ms | 4% |
#13 Index Scan | 0.794ms | 4% | |
entries_p2022_06_11 | 1 | 0.687ms | 4% |
#14 Index Scan | 0.687ms | 4% | |
entries_p2022_06_06 | 1 | 0.435ms | 2% |
#9 Index Scan | 0.435ms | 2% | |
entries_p2022_06_08 | 1 | 0.399ms | 2% |
#11 Index Scan | 0.399ms | 2% | |
entries_p2022_06_07 | 1 | 0.393ms | 2% |
#10 Index Scan | 0.393ms | 2% | |
entries_p2022_06_09 | 1 | 0.333ms | 2% |
#12 Index Scan | 0.333ms | 2% | |
entries_default | 1 | 0.032ms | 0% |
#16 Index Scan | 0.032ms | 0% |
Node Type | Count | Time | |
---|---|---|---|
Index Scan | 15 | 19.1ms | 99% |
#8 Index Scan | 4.72ms | 25% | |
#7 Index Scan | 2.77ms | 14% | |
#5 Index Scan | 2.1ms | 11% | |
#6 Index Scan | 1.55ms | 8% | |
#2 Index Scan | 1.51ms | 8% | |
#4 Index Scan | 1.19ms | 6% | |
#3 Index Scan | 1.17ms | 6% | |
#15 Index Scan | 1ms | 5% | |
#13 Index Scan | 0.794ms | 4% | |
#14 Index Scan | 0.687ms | 4% | |
#9 Index Scan | 0.435ms | 2% | |
#11 Index Scan | 0.399ms | 2% | |
#10 Index Scan | 0.393ms | 2% | |
#12 Index Scan | 0.333ms | 2% | |
#16 Index Scan | 0.032ms | 0% | |
Append | 1 | 0.027ms | 0% |
#1 Append | 0.027ms | 0% |
Index | Count | Time | |
---|---|---|---|
entries_p2022_06_05_person_id_cd_ct_idx | 1 | 4.72ms | 25% |
#8 Index Scan | 4.72ms | 25% | |
entries_p2022_06_04_person_id_cd_ct_idx | 1 | 2.77ms | 14% |
#7 Index Scan | 2.77ms | 14% | |
entries_p2022_06_02_person_id_cd_ct_idx | 1 | 2.1ms | 11% |
#5 Index Scan | 2.1ms | 11% | |
entries_p2022_06_03_person_id_cd_ct_idx | 1 | 1.55ms | 8% |
#6 Index Scan | 1.55ms | 8% | |
entries_p2022_05_30_person_id_cd_ct_idx | 1 | 1.51ms | 8% |
#2 Index Scan | 1.51ms | 8% | |
entries_p2022_06_01_person_id_cd_ct_idx | 1 | 1.19ms | 6% |
#4 Index Scan | 1.19ms | 6% | |
entries_p2022_05_31_person_id_cd_ct_idx | 1 | 1.17ms | 6% |
#3 Index Scan | 1.17ms | 6% | |
entries_p2022_06_12_person_id_cd_ct_idx | 1 | 1ms | 5% |
#15 Index Scan | 1ms | 5% | |
entries_p2022_06_10_person_id_cd_ct_idx | 1 | 0.794ms | 4% |
#13 Index Scan | 0.794ms | 4% | |
entries_p2022_06_11_person_id_cd_ct_idx | 1 | 0.687ms | 4% |
#14 Index Scan | 0.687ms | 4% | |
entries_p2022_06_06_person_id_cd_ct_idx | 1 | 0.435ms | 2% |
#9 Index Scan | 0.435ms | 2% | |
entries_p2022_06_08_person_id_cd_ct_idx | 1 | 0.399ms | 2% |
#11 Index Scan | 0.399ms | 2% | |
entries_p2022_06_07_person_id_cd_ct_idx | 1 | 0.393ms | 2% |
#10 Index Scan | 0.393ms | 2% | |
entries_p2022_06_09_person_id_cd_ct_idx | 1 | 0.333ms | 2% |
#12 Index Scan | 0.333ms | 2% | |
entries_default_driver_id_tsrange_idx | 1 | 0.032ms | 0% |
#16 Index Scan | 0.032ms | 0% |