X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 195229DC817 for ; Tue, 13 Dec 2005 07:50:07 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 40007-01 for ; Tue, 13 Dec 2005 07:50:09 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from zproxy.gmail.com (zproxy.gmail.com [64.233.162.197]) by postgresql.org (Postfix) with ESMTP id 668A69DC81E for ; Tue, 13 Dec 2005 07:50:04 -0400 (AST) Received: by zproxy.gmail.com with SMTP id 13so735600nzn for ; Tue, 13 Dec 2005 03:50:07 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=TURf7IFJhvG1Zner/upCOrHSFoTVEkjxNGtZ05C40/XeL66zafFMqs6zDSrVY7VdkQoPStwpSoD5q5vXmhtX5Ja8BbNNJa/UZ8+JHqlag89S5ReNFRgwhOExXxSXjtKLxQlTsQAbY1Y/hoHCsHifFuydvSf5aUJ/iBjP4H2jJM4= Received: by 10.64.253.16 with SMTP id a16mr503041qbi; Tue, 13 Dec 2005 03:50:07 -0800 (PST) Received: by 10.64.209.2 with HTTP; Tue, 13 Dec 2005 03:50:07 -0800 (PST) Message-ID: <5e744e3d0512130350l12d136abx2ad661c6d6b6a21e@mail.gmail.com> Date: Tue, 13 Dec 2005 17:20:07 +0530 From: Pandurangan R S To: Marc Cousin Subject: Re: partitioning Cc: pgsql-performance@postgresql.org In-Reply-To: <5e744e3d0512130340r25159d86n840831eb5aa6dd65@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <200512130920.47583.mcousin@sigma.fr> <5e744e3d0512130340r25159d86n840831eb5aa6dd65@mail.gmail.com> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.02 required=5 tests=[AWL=0.020] X-Spam-Score: 0.02 X-Spam-Level: X-Archive-Number: 200512/311 X-Sequence-Number: 16132 I just saw that there is no where clause in the query, that you had fed to explain plan. you need to include a where clause based on id_machine column to see the ef= fect. On 12/13/05, Pandurangan R S wrote: > Did you set constraint_exclusion =3D true in postgresql.conf file? > > On 12/13/05, Marc Cousin wrote: > > Hi, > > > > I've been working on trying to partition a big table (I've never partit= ioned a > > table in any other database till now). > > Everything went ok, except one query that didn't work afterwards. > > > > I've put the partition description, indexes, etc ..., and the explain p= lan > > attached. > > > > The query is extremely fast without partition (index scan backards on t= he > > primary key) > > > > The query is : "select * from logs order by id desc limit 100;" > > id is the primary key. > > > > It is indexed on all partitions. > > > > But the explain plan does full table scan on all partitions. > > > > While I think I understand why it is doing this plan right now, is ther= e > > something that could be done to optimize this case ? Or put a warning i= n the > > docs about this kind of behaviour. I guess normally someone would parti= tion > > to get faster queries :) > > > > Anyway, I thought I should mention this, as it has been quite a surpris= e. > > > > > > > > ---------------------------(end of broadcast)--------------------------= - > > TIP 1: if posting/reading through Usenet, please send an appropriate > > subscribe-nomail command to majordomo@postgresql.org so that you= r > > message can get through to the mailing list cleanly > > > > > > > > > > > -- > Regards > Pandu >