B
B
bismoney2021-09-28 02:02:13
PostgreSQL
bismoney, 2021-09-28 02:02:13

How to make postgreSQL fetch faster?

Hello guys!
There is a database with accounts that uses postgreSQL based on Yii2. I

'm trying to speed up the selection, but my knowledge is pumping me up.
61524d935230d054496536.png
61524d9a4769f558821583.png

Tried default btree, tried brin.
There is not much data in the database, throw in your thoughts.
If you need any information, please let me know.

Thank you!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
K
ky0, 2021-09-28
@ky0

What bothers you? 15 ms for such a monstrous select is still excellent, which means there is enough memory for the database.
It's just that you probably don't need to make such requests for each sneeze, somehow caching - and everything will be fine.

D
Dmitry Osipov, 2021-09-28
@Shiftuia

You can try to select *explicitly list the required fields instead, if only some of them are needed.
Still, if the id are listed in order, then replacing inwithbetween

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question