From: Luís Roberto Weck <luisroberto@siscobra.com.br>
To: Michael Lewis <mlewis@entrata.com>
Cc: pgsql-performance@lists.postgresql.org
Subject: Re: Slow query on a one-tuple table
Date: Thu, 19 Sep 2019 16:59:01 -0300
Message-ID: <bf03aedc-9201-f7c9-ef25-e795d4e1626a@siscobra.com.br> (raw)
In-Reply-To: <BN6PR1701MB1890E31E15D486A85FEC8510DA890@BN6PR1701MB1890.namprd17.prod.outlook.com>
References: <CA+t6e1kacbVHq69aihEVeBzH_nMY5eK7bZ-UXL_FuUquEgF_gg@mail.gmail.com>
<24571.1568910502@sss.pgh.pa.us>
<774d6080-d6d7-e9e7-7351-9a412c7d5956@siscobra.com.br>
<CAHOFxGqMpUxn54jMLoU4-HcUata2yfLgjEbRHdJG3k0BBDPbog@mail.gmail.com>
<ab6ea98e-6266-7665-40b7-151c5736c08d@siscobra.com.br>
<BN6PR1701MB1890E31E15D486A85FEC8510DA890@BN6PR1701MB1890.namprd17.prod.outlook.com>
Em 19/09/2019 15:34, Igor Neyman escreveu:
> -----Original Message-----
> From: Luís Roberto Weck [mailto:luisroberto@siscobra.com.br]
> Sent: Thursday, September 19, 2019 2:30 PM
> To: Michael Lewis <mlewis@entrata.com>
> Cc: pgsql-performance@lists.postgresql.org
> Subject: Re: Slow query on a one-tuple table
>
> WARNING: This email originated from outside of Perceptron! Please be mindful of PHISHING and MALWARE risks.
>
> Em 19/09/2019 14:21, Michael Lewis escreveu:
>> Is this result able to be repeated?
> Yes, I can consistently repeat it.
>
> Postgres version is 11.1.
>
> Other executions:
>
> Index Scan using assessoria_pkey on public.assessoria (cost=0.25..2.47
> rows=1 width=62) (actual time=1.591..4.035 rows=1 loops=1)
> Output: asscod, asscambol
> Index Cond: (assessoria.asscod = 1)
> Buffers: shared hit=1187
> Planning Time: 0.053 ms
> Execution Time: 4.055 ms
>
> Index Scan using assessoria_pkey on public.assessoria (cost=0.25..2.47
> rows=1 width=62) (actual time=1.369..3.838 rows=1 loops=1)
> Output: asscod, asscambol
> Index Cond: (assessoria.asscod = 1)
> Buffers: shared hit=1187
> Planning Time: 0.033 ms
> Execution Time: 3.851 ms
>
> ________________________________________________________________________________________________________________
>
> But can you repeat it with "LIMIT 1"?
> Notice huge difference in "buffers hit" while doing (the same) Index Scan in two plans.
>
> Regards,
> Igor Neyman
With LIMIT 1, I get 3 shared buffers hit, pretty much always.
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, mlewis@entrata.com, pgsql-performance@lists.postgresql.org
Subject: Re: Slow query on a one-tuple table
In-Reply-To: <bf03aedc-9201-f7c9-ef25-e795d4e1626a@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