Advertisement
Guest User

Untitled

a guest
Jul 27th, 2016
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. CREATE INDEX foo_my_timestamp_idx
  2. ON foo
  3. USING btree
  4. ((my_timestamp::date) DESC);
  5.  
  6. CLUSTER foo USING foo_my_timestamp_idx;
  7.  
  8. CREATE INDEX foo_my_timestamp_idx ON foo (my_timestamp);
  9.  
  10. SELECT * FROM foo
  11. WHERE my_timestamp::date = '2016-07-25';
  12.  
  13. SELECT * FROM foo
  14. WHERE my_timestamp >= '2016-07-25'
  15. WHERE my_timestamp < '2016-07-26';
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement