Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CREATE INDEX foo_my_timestamp_idx
- ON foo
- USING btree
- ((my_timestamp::date) DESC);
- CLUSTER foo USING foo_my_timestamp_idx;
- CREATE INDEX foo_my_timestamp_idx ON foo (my_timestamp);
- SELECT * FROM foo
- WHERE my_timestamp::date = '2016-07-25';
- SELECT * FROM foo
- WHERE my_timestamp >= '2016-07-25'
- WHERE my_timestamp < '2016-07-26';
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement