4 ms·
You don't need that if you use postgresql: create index foo1 on t1 (date(timestamp)) create index foo2 on t2 (extract(week from timestamp)) Postgres c
by bjourne 13y ago
You don't need that if you use postgresql:
create index foo1 on t1 (date(timestamp))
create index foo2 on t2 (extract(week from timestamp))
Postgres can use almost any row expression as an index.
- kalleboo 13y agoThese are the cool practical reasons to switch from MySQL to Postgres that I so rarely see (usually the reasons are more ad hominem and handwavy).
- orf 13y agoReally? There are loads of practical arguments: The incredibly rich type system (hello array/schemaless columns), indexes (partial indexes, several different types to choose from), language integration (write index functions in javascript/python/ruby/c), foreign data wrappers (connect pg to mysql/mongodb/etc) to name but a few.
- kalleboo 13y agoI don't doubt they exist, it's just in the comments on HN, usually the only thing that's touted is that "it's not MySQL" in that it doesn't have the quirks MySQL does (in regards to silently munging data types, etc). Sometimes performance/scalability is also discussed.