pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Casey Deccio <casey@deccio.net>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: [External] LIMIT not showing all results
Date: Tue, 05 Mar 2019 11:46:18 -0500
Message-ID: <2871.1551804378@sss.pgh.pa.us> (raw)
In-Reply-To: <2AA9443B-57B7-4088-8B8F-957703E206F0@deccio.net>
References: <85CFAA9E-E10B-4B1E-8C79-7793CC92BA82@deccio.net>
	<CAE7uO5jf+EytMXTv2Qg=Bg=NfLkbaJqO6PRtEr28R8sAh695mw@mail.gmail.com>
	<2AA9443B-57B7-4088-8B8F-957703E206F0@deccio.net>

Casey Deccio <casey@deccio.net> writes:
>> On Mar 5, 2019, at 9:15 AM, Vijaykumar Jain <vjain@opentable.com> wrote:
>> Can you run both the queries with
>> “explain analyze select ....” and paste the output.

> dnsviz=> explain analyze select id,name,date from analysis where name = 'foo' order by date desc limit 20;               
>                                                                                                  QUERY PLAN                                                                
                                                                                                                                                                           
> ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
> ----------------------------------                                                                                                                                         
>  Limit  (cost=0.57..81.74 rows=20 width=31) (actual time=0.540..0.541 rows=1 loops=1)                                                                                      
>    ->  Index Scan Backward using analysis_name_date_key on analysis  (cost=0.57..7760.25 rows=1912 width=31) (actual 
> time=0.539..0.540 rows=1 loops=1)                                                                                                                                          
>          Index Cond: ((name)::text = 'foo'::text)
>  Planning time: 6.728 ms
>  Execution time: 0.587 ms
> (5 rows)

Hm, so possibly corruption in that index?  REINDEX might help.

			regards, tom lane




view thread (20+ messages)  latest in thread

Message-ID: <2871.1551804378@sss.pgh.pa.us>
Permalink:  ../2871.1551804378@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/2871.1551804378@sss.pgh.pa.us

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: tgl@sss.pgh.pa.us, casey@deccio.net
  Subject: Re: [External] LIMIT not showing all results
  In-Reply-To: <2871.1551804378@sss.pgh.pa.us>
  References: <85CFAA9E-E10B-4B1E-8C79-7793CC92BA82@deccio.net> <CAE7uO5jf+EytMXTv2Qg=Bg=NfLkbaJqO6PRtEr28R8sAh695mw@mail.gmail.com> <2AA9443B-57B7-4088-8B8F-957703E206F0@deccio.net> <2871.1551804378@sss.pgh.pa.us>

* 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