Slow query on a one-tuple table

From: Luís Roberto Weck <luisroberto(at)siscobra(dot)com(dot)br>
To: pgsql-performance(at)lists(dot)postgresql(dot)org
Subject: Slow query on a one-tuple table
Date: 2019-09-19 16:55:46
Message-ID: 774d6080-d6d7-e9e7-7351-9a412c7d5956@siscobra.com.br
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Hi!

I have a query that SELECT's only one tuple using a PK
(https://explain.depesz.com/s/Hskt) <https://explain.depesz.com/s/Hskt>

the field I am selecting are a bigint and a text. Why does it read 1095
shared buffers read?

If I adda LIMIT 1 clause, the query runs much faster:
https://explain.depesz.com/s/bSZn

This table has only one tuple anyway, so I can't understand why does it
takes so long without the LIMIT 1.
<https://explain.depesz.com/s/Hskt>

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Joao Junior 2019-09-19 17:00:01 Re: Delete huge Table under XFS
Previous Message Andreas Kretschmer 2019-09-19 16:50:11 Re: Delete huge Table under XFS