pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Milen Kulev <makulev@gmx.net>
To: 'Tom Lane' <tgl@sss.pgh.pa.us>
Cc: pgsql-performance@postgresql.org
Subject: Re: Partition elimination problem
Date: Mon, 18 Sep 2006 08:07:51 +0200
Message-ID: <000001c6dae8$cc658170$0a00a8c0@trivadis.com> (raw)
In-Reply-To: <27954.1158534812@sss.pgh.pa.us>

Hi Tom,
You are right, of course :


pgpool=# set  constraint_exclusion = on ;
SET
pgpool=# explain analyze  select * from part  where id1=3 and id2=5 ;
                                                                     QUERY PLAN

------------------------------------------------------------------------------------------------------------------------
-----------------------------
 Result  (cost=0.00..289.92 rows=3 width=130) (actual time=3.604..27.839 rows=483 loops=1)
   ->  Append  (cost=0.00..289.92 rows=3 width=130) (actual time=3.600..22.550 rows=483 loops=1)
         ->  Seq Scan on part  (cost=0.00..24.85 rows=1 width=130) (actual time=0.001..0.001 rows=0 loops=1)
               Filter: ((id1 = 3) AND (id2 = 5))
         ->  Bitmap Heap Scan on part_id1_0_10 part  (cost=1.02..9.50 rows=1 width=130) (actual time=0.014..0.014 rows=0
loops=1)
               Recheck Cond: (id1 = 3)
               Filter: (id2 = 5)
               ->  Bitmap Index Scan on idx_part_id1_0_10  (cost=0.00..1.02 rows=5 width=0) (actual time=0.009..0.009
rows=0 loops=1)
                     Index Cond: (id1 = 3)
         ->  Bitmap Heap Scan on part_id1_0_10__id2_0_10 part  (cost=2.52..255.56 rows=1 width=130) (actual
time=3.578..20.377 rows=483 loops=1)
               Recheck Cond: (id2 = 5)
               Filter: (id1 = 3)
               ->  Bitmap Index Scan on idx_part_id1_0_10__id2_0_10  (cost=0.00..2.52 rows=148 width=0) (actual
time=3.460..3.460 rows=5242 loops=1)
                     Index Cond: (id2 = 5)
 Total runtime: 30.576 ms


Now the execution plan  looks good. 
And now I have another problem -> constraint_exclusion  is on in the postgresql.conf file.
BUT  in my psql session I see something different ;(. Only after setting this parameter  explicitely in the session, it
works.
What I have done wrong  ?
 
 
pgpool=# show constraint_exclusion ;
 constraint_exclusion
----------------------
 off
(1 row)
 
pgpool=# set  constraint_exclusion = on ;
SET
pgpool=#  show constraint_exclusion ;
 constraint_exclusion
----------------------
 on
(1 row)

 
Best Regards. 
Milen 


-----Original Message-----
From: Tom Lane [mailto:tgl@sss.pgh.pa.us]
Sent: Monday, September 18, 2006 1:14 AM
To: Milen Kulev
Cc: pgsql-performance@postgresql.org
Subject: Re: [PERFORM] Partition elimination problem


"Milen Kulev" <makulev@gmx.net> writes:
> My Problem is that  I don't see partiotion elimination feature
> (Parameer = constraint_exclusion is ON):

Your example works as expected for me.  You *sure* you have constraint_exclusion turned on?

                        regards, tom lane

view thread (3+ messages)

Message-ID: <000001c6dae8$cc658170$0a00a8c0@trivadis.com>
Permalink:  ../000001c6dae8$cc658170$0a00a8c0@trivadis.com/
Also on:    postgresql.org/message-id/000001c6dae8$cc658170$0a00a8c0@trivadis.com

 · 

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: makulev@gmx.net, tgl@sss.pgh.pa.us
  Subject: Re: Partition elimination problem
  In-Reply-To: <000001c6dae8$cc658170$0a00a8c0@trivadis.com>

* 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