Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id F0DFE2E0032 for ; Tue, 26 Feb 2008 12:32:01 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 52733-04 for ; Tue, 26 Feb 2008 12:31:49 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 08F982E003E for ; Tue, 26 Feb 2008 12:31:49 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id m1QGVh2v003638; Tue, 26 Feb 2008 11:31:43 -0500 (EST) To: "Laurent Raufaste" cc: pgsql-performance@postgresql.org Subject: Re: PG planning randomly ? In-reply-to: <669dc9710802260719h61d846b3hd50b7f547bcb82c3@mail.gmail.com> References: <669dc9710802260719h61d846b3hd50b7f547bcb82c3@mail.gmail.com> Comments: In-reply-to "Laurent Raufaste" message dated "Tue, 26 Feb 2008 16:19:03 +0100" Date: Tue, 26 Feb 2008 11:31:42 -0500 Message-ID: <3637.1204043502@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200802/343 X-Sequence-Number: 28885 "Laurent Raufaste" writes: > I'm having some issues with this simple query: > SELECT > _comment.*, > _article.title AS article_title, > _article.reference AS article_reference > FROM > _comment > INNER JOIN _article > ON _article.id = _comment.parent_id > WHERE > _comment.path <@ '0.1.3557034' > ORDER BY > _comment.date_publishing DESC > OFFSET 0 > LIMIT 5 > ; > The varying information here is the ltree path "0.1.3557034" What PG version is this? If it's 8.2 or later then increasing the stats target for _comment.path to 100 or more would likely help. regards, tom lane