public inbox for [email protected]  
help / color / mirror / Atom feed
From: Subramaniam C <[email protected]>
To: [email protected]
Subject: Query regarding EXPLAIN (ANALYZE,BUFFERS)
Date: Thu, 21 Sep 2017 16:22:11 +0530
Message-ID: <CAL=06W=MhSudwH5uS2b3oMBCnJzfP1OO-OrKdy8wTmX0HEDQTQ@mail.gmail.com> (raw)
List-Unsubscribe:  <mailto:[email protected]?body=unsub%20pgsql-performance>

Hi

I wanted to query top 20 rows by joining two tables, one table having
around 1 lac rows and other table having 5 lac rows. Since I am using ORDER
BY in the query so I created compound index with the columns being used in
ORDER BY. Initially index size was  939 MB.

Then I ran EXPLAIN(ANALYZE,BUFFERS) for this query which took around 20
secs as it was not using the compound index for this query. So I drop this
index and created again. The index size now got reduced to 559 MB.

After this if I ran the EXPLAIN(ANALYZE,BUFFERS) for this query it was
using the index and took only 5 secs.

Can you please explain how the index size got reduced after recreating it
and how the query started using the index after recreating?

Thanks and Regards
Subramaniam


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: [email protected]
  Cc: [email protected]
  Subject: Re: Query regarding EXPLAIN (ANALYZE,BUFFERS)
  In-Reply-To: <CAL=06W=MhSudwH5uS2b3oMBCnJzfP1OO-OrKdy8wTmX0HEDQTQ@mail.gmail.com>

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

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