On Thu, Mar 13, 2025 at 11:49 PM Durgamahesh Manne <maheshpostgres9@xxxxxxxxx> wrote:
To return one row takes 43ms is not optimal
It's actually much faster than that, but even 43ms is overall good. The query is already pretty optimal, as it uses a single index only scan. There are a few tricks left to make this potentially faster, but you may want to look into using some sort of in-memory caching system if your application is that sensitive to timings. Or find us a version in which the execution time is not 1/20th of a millisecond and we can work on that one.
Also take a look at pg_stat_statements so you can see how fast the query is on average.
Cheers,
Greg
--
Crunchy Data - https://www.crunchydata.com
Enterprise Postgres Software Products & Tech Support