4 ms·
Are you sure about that? https://www.postgresql.org/docs/9.1/sql-cluster.html https://www.postgresql.org/docs/9.1/sql-cluster.html
by mmaurizi 8y ago
Are you sure about that? https://www.postgresql.org/docs/9.1/sql-cluster.html https://www.postgresql.org/docs/9.1/sql-cluster.html
- polskibus 8y agoThat's not how a real clustered primary key works, because "the changes are not clustered.".
- asah 8y agocan confirm. That said, one can often capture much of the performance benefit with Postgres indexes - basically, instead of trying to tightly-pack the base tables, copy the data into indexes which are tightly packed exactly as you need. Put another way, Postgres indexes are synchronously updated materialized views - and yes, the Postgres planner/optimizer will automatically answer queries from an index if it's faster and all the columns are in there. I esp recommend reading about function and expression indexes, as well as the (new) covering indexes. http://blog.scoutapp.com/articles/2016/05/31/3-postgresql-indexing-tricks-that-surprise-everyone http://blog.scoutapp.com/articles/2016/05/31/3-postgresql-in... https://www.endpoint.com/blog/2013/06/10/postgresql-functional-indexes https://www.endpoint.com/blog/2013/06/10/postgresql-function... https://paquier.xyz/postgresql-2/postgres-11-covering-indexes/ https://paquier.xyz/postgresql-2/postgres-11-covering-indexe...