pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Milen Kulev <makulev@gmx.net>
To: pgsql-general@postgresql.org
Subject: Re: Partitioning...
Date: Tue, 13 Jun 2006 00:34:44 +0200
Message-ID: <007a01c68e70$6710e680$0a00a8c0@trivadis.com> (raw)
In-Reply-To: <13199.1150150666@sss.pgh.pa.us>

 BTW , I can not see the planner to prune/isolate the right table/partion ?
(constraint_exclusion=on, Version= 8.1.3 on RHEL4)

postgres=#  explain analyze  select count(id1) from part_all  where id1 =12 ;
                                                                   QUERY PLAN

---------------------------------------------------------------------------------------------------
 Aggregate  (cost=5951.74..5951.75 rows=1 width=4) (actual time=111.687..111.688 rows=1 loops=1)
   ->  Append  (cost=164.60..5463.19 rows=39084 width=49) (actual time=4.764..91.488 rows=13203 loops=1)
         ->  Bitmap Heap Scan on part_id1_0_10  (cost=164.60..3577.60 rows=25600 width=49) (actual time=0.123..0.123
rows=0 loops=1)
               Recheck Cond: (id1 = 12)
               ->  Bitmap Index Scan on idx_part_id1_0_10  (cost=0.00..164.60 rows=25600 width=0) (actual
time=0.119..0.119 rows=0 loops=1)
                     Index Cond: (id1 = 12)
         ->  Bitmap Heap Scan on part_id1_11_20  (cost=88.19..1494.74 rows=13484 width=49) (actual time=4.635..55.140
rows=13203 loops=1)
               Recheck Cond: (id1 = 12)
               ->  Bitmap Index Scan on idx_part_id1_11_20  (cost=0.00..88.19 rows=13484 width=0) (actual
time=4.067..4.067 rows=13205 loops=1)
                     Index Cond: (id1 = 12)
 Total runtime: 111.812 ms
(11 rows)

Time: 114.779 ms


Regards. Milen


-----Original Message-----
From: pgsql-general-owner@postgresql.org [mailto:pgsql-general-owner@postgresql.org] On Behalf Of Tom Lane
Sent: Tuesday, June 13, 2006 12:18 AM
To: Milen Kulev
Cc: pgsql-general@postgresql.org
Subject: Re: [GENERAL] Partitioning... 


"Milen Kulev" <makulev@gmx.net> writes:
> But When I issue:
>  insert into  part(id1, id2, filler)
>  select  
>  round(  (random()*20)::bigint,0) as id1, <---!!! Note that both partitions should be populated!
>  round( (random()*20)::bigint,0) as id2,
>  'TTTTTTTTTTTESTTTTTZZZZZZZZZZZZZZZZZZZ'
>  from  generate_series(0,100000);

>  ERROR:  new row for relation "part_id1_0_10" violates check 
> constraint "part_id1_0_10_id1_check"

Don't use random() in your test case.

			regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
       subscribe-nomail command to majordomo@postgresql.org so that your
       message can get through to the mailing list cleanly




view thread (32+ messages)  latest in thread

Message-ID: <007a01c68e70$6710e680$0a00a8c0@trivadis.com>
Permalink:  ../007a01c68e70$6710e680$0a00a8c0@trivadis.com/
Also on:    postgresql.org/message-id/007a01c68e70$6710e680$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 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: makulev@gmx.net
  Subject: Re: Partitioning...
  In-Reply-To: <007a01c68e70$6710e680$0a00a8c0@trivadis.com>
  References: <13199.1150150666@sss.pgh.pa.us> <007a01c68e70$6710e680$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