pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: CG <cgg007@yahoo.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: Nested loops are killing throughput
Date: Tue, 19 Sep 2006 11:03:07 -0400
Message-ID: <4769.1158678187@sss.pgh.pa.us> (raw)
In-Reply-To: <20060919144628.32833.qmail@web37903.mail.mud.yahoo.com>
References: <20060919144628.32833.qmail@web37903.mail.mud.yahoo.com>

CG <cgg007@yahoo.com> writes:
>                     ->  Nested Loop  (cost=0.00..744.28 rows=1 width=16) (actual time=31.227..6980.765 rows=5436 loops=1)
>                           ->  Nested Loop  (cost=0.00..135.29 rows=101 width=16) (actual time=25.514..273.660 rows=5436 loops=1)
> ...
>                           ->  Index Scan using packet_status_puuid_pkey on packet_status dps  (cost=0.00..6.02 rows=1 width=16) (actual time=1.226..1.228 rows=1 loops=5436)
>                                 Index Cond: (dps.packet_uuid = "outer".packet_uuid)
>                                 Filter: ((status & 2) = 0)

One problem you've got is that the planner has no stats about the
selectivity of that status condition.  My advice would be to forget the
cute bitmask and store one or more plain boolean columns.  Easier to
write queries against and way more tractable statistically.

			regards, tom lane



view thread (8+ messages)  latest in thread

Message-ID: <4769.1158678187@sss.pgh.pa.us>
Permalink:  ../4769.1158678187@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/4769.1158678187@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-sql@postgresql.org
  Cc: tgl@sss.pgh.pa.us, cgg007@yahoo.com
  Subject: Re: Nested loops are killing throughput
  In-Reply-To: <4769.1158678187@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