pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Luís Roberto Weck <luisroberto@siscobra.com.br>
To: pgsql-performance@lists.postgresql.org
Subject: Slow query on a one-tuple table
Date: Thu, 19 Sep 2019 13:55:46 -0300
Message-ID: <774d6080-d6d7-e9e7-7351-9a412c7d5956@siscobra.com.br> (raw)
In-Reply-To: <24571.1568910502@sss.pgh.pa.us>
References: <CA+t6e1kacbVHq69aihEVeBzH_nMY5eK7bZ-UXL_FuUquEgF_gg@mail.gmail.com>
	<24571.1568910502@sss.pgh.pa.us>

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;

view thread (13+ messages)  latest in thread

Message-ID: <774d6080-d6d7-e9e7-7351-9a412c7d5956@siscobra.com.br>
Permalink:  ../774d6080-d6d7-e9e7-7351-9a412c7d5956@siscobra.com.br/
Also on:    postgresql.org/message-id/774d6080-d6d7-e9e7-7351-9a412c7d5956@siscobra.com.br

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: luisroberto@siscobra.com.br, pgsql-performance@lists.postgresql.org
  Subject: Re: Slow query on a one-tuple table
  In-Reply-To: <774d6080-d6d7-e9e7-7351-9a412c7d5956@siscobra.com.br>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox