Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id D7D3AB61569 for ; Tue, 31 May 2011 04:21:07 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 24289-08 for ; Tue, 31 May 2011 07:21:00 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-ew0-f46.google.com (mail-ew0-f46.google.com [209.85.215.46]) by mail.postgresql.org (Postfix) with ESMTP id 2F80FB61566 for ; Tue, 31 May 2011 04:20:59 -0300 (ADT) Received: by ewy4 with SMTP id 4so1526370ewy.19 for ; Tue, 31 May 2011 00:20:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:date:message-id:subject:from:to:cc :content-type; bh=XYSi249uV5fR3GVDxS6S7ngLAGp/bN2xQqaO4TMQdVo=; b=wpolYbhTsyg6eRUtIg4RmJEYVWTuRSk/+FThsdhJd7rNrJK2ahaFh68y9xWEW+S/21 41RKxCVRTRzH3YJBAkanOMlc4h3Mvgo3k8qupBkJJFnRWjMy6RiNJcqREGqByrbFfL1u gMFw/XH9i6ofMjvMFwsGyup/vUAwHIyBaQS4Q= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:cc:content-type; b=xxmBnYtOFP7DyzGAhNozQuMEu+bs0739ds5PO1M/Dr1glbfc95vAZaiDPpzsj0L7Kn /nawPe91jxzKMmcn6DIDly7J7ZW0uYKLULoBzAfDVmwMQkwRMlNwCrXuMspaUVVXH7Rd HaJ7qeU5jPyFIHDa9pq5AU7Ns7Vcb5TvzwihA= MIME-Version: 1.0 Received: by 10.213.10.9 with SMTP id n9mr1212519ebn.135.1306826459399; Tue, 31 May 2011 00:20:59 -0700 (PDT) Received: by 10.213.31.210 with HTTP; Tue, 31 May 2011 00:20:59 -0700 (PDT) Date: Tue, 31 May 2011 10:20:59 +0300 Message-ID: Subject: Strange behavior of child table. From: Jenish To: pgsql-performance@postgresql.org Cc: jenish vyas Content-Type: multipart/alternative; boundary=0015174bdf4ee5458904a48d3e1d X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.887 tagged_above=-10 required=5 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RFC_ABUSE_POST=0.001, T_TO_NO_BRKTS_FREEMAIL=0.01 X-Spam-Level: X-Archive-Number: 201105/416 X-Sequence-Number: 43925 --0015174bdf4ee5458904a48d3e1d Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi All, I have created partition on table Round_Action , which has 3 child partitio= n tables. When I am firing a simple select query with limit on parent table it is taking huge time to execute. But when I am firing this query directly on child table it is taking few milliseconds. EXP. select * from Round_Action where action_id =3D50000 limit 100 =E2=86=92 exe= cution time 80 sec select * from Round_Action_CH1 action_id =3D50000 limit 100 =E2=86=92 execu= tion time 0.1 sec Round_Action is the parent table and has no record in the tables, all the records are lying in child tables. Table is having index on action_id. Partition is trigger based. Postgres Version : (PostgreSQL) 8.4.6 Why there is difference in execution time? What I am doing wrong? --=20 Thanks & regards, JENISH --0015174bdf4ee5458904a48d3e1d Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi All,=C2=A0=20

I have created partition on table Round_Act= ion , which has 3 child partition tables.


When I am firing a simple select query with= limit on parent table it is taking huge time to execute. But when I am fir= ing this query directly on child table it is taking few milliseconds.


EXP.
select * from Round_Action where action_i= d =3D50000 limit 100 =E2=86=92 execution time 80 sec

select * from Round_Action_CH1 action_id = =3D50000 limit 100 =E2=86=92 execution time 0.1 sec

Round_Action is the parent table and has no= record in the tables, all the records are lying in child tables.

Table is having index on action_id.

Partition is trigger based.

Postgres Version : (PostgreSQL) 8.4.6
=C2=A0
Why there is difference in execution time? What I am doing wrong?



--
Thanks & regards,
=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 JENISH


--0015174bdf4ee5458904a48d3e1d--