Maybe I'm wrong, but for this query: SELECT * FROM benchmark_logs WHERE severity this index CREATE INDEX ON benchmark_logs (severity, timestamp); cannot be used as proposed: "Postgres can jump directly to the portion of the tree matching severity Postgres with this index can walk to a part of the tree with severity < 3, but timestamps are sorted only for the same severity.
Optimizing Top K in Postgres
11–20 of 26 posts
Re: Optimizing Top K in Postgres
#12Maybe I'm wrong, but for this query: SELECT * FROM benchmark_logs WHERE severity this index CREATE INDEX ON benchmark_logs (severity, timestamp); cannot be used as proposed: "Postgres can jump directly to the portion of the tree matching severity Postgres with this index can walk to a part of the tree with severity < 3, but timestamps are sorted only for the same severity.
The SQLite documentation explains how (and how well) this works: https://www.sqlite.org/optoverview.html#the_skip_scan_optimi...
Re: Optimizing Top K in Postgres
#13Re: Optimizing Top K in Postgres
#14Maybe I'm wrong, but for this query: SELECT * FROM benchmark_logs WHERE severity this index CREATE INDEX ON benchmark_logs (severity, timestamp); cannot be used as proposed: "Postgres can jump directly to the portion of the tree matching severity Postgres with this index can walk to a part of the tree with severity < 3, but timestamps are sorted only for the same severity.
If severity is a low cardinality enum, it still seems acceptable
Re: Optimizing Top K in Postgres
#15The issue here is the row based format. You simply can't filter on arbitrary columns with that. Either use an external warehouse or a columnar plug-in like Timescale.
Re: Optimizing Top K in Postgres
#16The issue here is the row based format. You simply can't filter on arbitrary columns with that. Either use an external warehouse or a columnar plug-in like Timescale.
Re: Optimizing Top K in Postgres
#17Maybe I'm wrong, but for this query: SELECT * FROM benchmark_logs WHERE severity this index CREATE INDEX ON benchmark_logs (severity, timestamp); cannot be used as proposed: "Postgres can jump directly to the portion of the tree matching severity Postgres with this index can walk to a part of the tree with severity < 3, but timestamps are sorted only for the same severity.
Re: Optimizing Top K in Postgres
#18Re: Optimizing Top K in Postgres
#19Postgres is really good at a lot of things, but it's very unfortunate that it's really bad at simple analytics. I wish there was a plugin instead of having to have N databases
Re: Optimizing Top K in Postgres
#20Postgres is really good at a lot of things, but it's very unfortunate that it's really bad at simple analytics. I wish there was a plugin instead of having to have N databases
ParadeDB is a pair of postgres plugins.