3 ms·
• EXPLAIN output is awesome (once you understand the format, you'll know exact algorithm postgres uses for the query with bottlenecks highlighted) • Subqueries
by pornel 15y ago
• EXPLAIN output is awesome (once you understand the format, you'll know exact algorithm postgres uses for the query with bottlenecks highlighted)
• Subqueries are optimised as well as JOINs. I can go all-Inception in my queries and they perform well (I find subquery style often easier to understand than equivalent JOIN).
• You can do UPDATE … SELECT on the same table.
• Postgres has query rewrite (RULE) that can be used to implement writeable VIEWs (which is awesome for migrating legacy applications to new schema)
The only thing I really miss from MySQL is ON DUPLICATE KEY UPDATE. Postgres has only weak 1-row hacks emulating this, and "standard" MERGE syntax for this is horribly ugly.