pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Svetlin Manavski <svetlin.manavski@gmail.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Unexpected seq scans when expected result is 1 row out of milions
Date: Fri, 15 Jul 2011 13:58:49 -0400
Message-ID: <4223.1310752729@sss.pgh.pa.us> (raw)
In-Reply-To: <CAMm+ggR=-+pqw9Qo7uQ6dx9pa0bUfBEXz6z-+UfUNGvRuJuBXA@mail.gmail.com>
References: <CAMm+ggR=-+pqw9Qo7uQ6dx9pa0bUfBEXz6z-+UfUNGvRuJuBXA@mail.gmail.com>

Svetlin Manavski <svetlin.manavski@gmail.com> writes:
> The question is: why do we get a seq scan on appqosdata.tcpsessiondata_1 and
> appqosdata.tcpsessiondata_2 even if the planner estimates correctly 1 row
> out of millions could potentially be selected? As you can see ~90% of the
> time is spent on those 2 partitions even if they are not apparently
> different from any of the others.

Well, there must be *something* different about them.  Are you sure
they've got the same indexes as the others?  It would be useful to see
psql's \d report for those partitions, as well as for one of the
partitions that's behaving as expected.  You might also compare the
EXPLAIN results for doing the query on just one child table between
the normal and misbehaving partitions.

			regards, tom lane



view thread (2+ messages)

Message-ID: <4223.1310752729@sss.pgh.pa.us>
Permalink:  ../4223.1310752729@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/4223.1310752729@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 using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: tgl@sss.pgh.pa.us, svetlin.manavski@gmail.com
  Subject: Re: Unexpected seq scans when expected result is 1 row out of milions
  In-Reply-To: <4223.1310752729@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