|
|
|
Ask HN: 120M rows Postgres – how can I speed up queries?
|
|
23 points
by dbnewbie
2419 days ago
|
|
The table is flat (no related), but many queries we make (including aggregates) take hundreds of milliseconds. Forgetting the specific queries for a moment (basically all queries in this table are relatively slow): How would you handle such a scenario? Shard the database? |
|
https://pgtune.leopard.in.ua/#/
Are you monitoring your machine to check if it is not starving on cpu?
Re the queries, we have been using pgbadger to collect metrics about the usage of the dB and the slowest queries by type. This is helpful as it guides where you should put your efforts.
https://github.com/darold/pgbadger/blob/master/README.md
This is very good ref about scaling Postgres.
https://pyvideo.org/pycon-ca-2017/postgres-at-any-scale.html