Received: from makus.postgresql.org ([98.129.198.125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TCDI3-0003xx-7L for pgsql-performance@postgresql.org; Thu, 13 Sep 2012 17:33:23 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TCDI1-00018q-Pe for pgsql-performance@postgresql.org; Thu, 13 Sep 2012 17:33:22 +0000 Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.5/8.14.5) with ESMTP id q8DHXJaP016906; Thu, 13 Sep 2012 13:33:19 -0400 (EDT) From: Tom Lane To: Bill Martin cc: "pgsql-performance@postgresql.org" Subject: Re: Planner selects different execution plans depending on limit In-reply-to: References: <5051F227.7090600@krogh.cc>, <26906.1347548059@sss.pgh.pa.us> Comments: In-reply-to Bill Martin message dated "Thu, 13 Sep 2012 17:19:10 -0000" Date: Thu, 13 Sep 2012 13:33:19 -0400 Message-ID: <16905.1347557599@sss.pgh.pa.us> X-Pg-Spam-Score: -2.4 (--) X-Archive-Number: 201209/57 X-Sequence-Number: 47803 Bill Martin writes: > Tom Lane writes: >> He can do it without having to change his schema --- but it's the index >> column, not the underlying content column, that needs its statistics >> target adjusted. > How can I adjust the statistics target of the index? Just pretend it's a table. ALTER TABLE index_name ALTER COLUMN column_name SET STATISTICS ... You'll need to look at the index (eg with \d) to see what the name of the desired column is, since index expressions have system-assigned column names. regards, tom lane