Optimize PostgreSQL read-only tables

后端 未结 2 814
名媛妹妹
名媛妹妹 2020-12-30 12:24

I have many read-only tables in a Postgres database. All of these tables can be queried using any combination of columns.

What can I do to optimize queries? Is it a

2条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-30 12:50

    If you have filtering by more columns indexes may help but not too much. Also indexes may not help for small tables.

    First search for "postgresql tuning" - you will find usefull information.

    If database can fit in memory - buy enough RAM. If database can not fit in memory - SSD will help. If this is not enough and database is read only - run 2, 3 or more servers. Or partition database (in the best case to fit in memory of each server).

    Even if queries are generated I think they will not be random. Monitor database for slow queries and improve only them.

提交回复
热议问题