Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TRls9-0006Wl-FL for pgsql-performance@postgresql.org; Fri, 26 Oct 2012 15:30:57 +0000 Received: from mh10.mail.rice.edu ([128.42.201.30]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TRls1-0006kX-Uk for pgsql-performance@postgresql.org; Fri, 26 Oct 2012 15:30:57 +0000 Received: from mh10.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh10.mail.rice.edu (Postfix) with ESMTP id 9E218603E1; Fri, 26 Oct 2012 10:30:48 -0500 (CDT) Received: from mh10.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh10.mail.rice.edu (Postfix) with ESMTP id 9C866603DB; Fri, 26 Oct 2012 10:30:48 -0500 (CDT) X-Virus-Scanned: by amavis-2.7.0 at mh10.mail.rice.edu, auth channel Received: from mh10.mail.rice.edu ([127.0.0.1]) by mh10.mail.rice.edu (mh10.mail.rice.edu [127.0.0.1]) (amavis, port 10026) with ESMTP id SrncDYLfihgy; Fri, 26 Oct 2012 10:30:48 -0500 (CDT) X-SMTP-Auth: no X-SMTP-Auth: no Received: from aart.rice.edu (aart.rice.edu [168.7.56.48]) by mh10.mail.rice.edu (Postfix) with ESMTP id 83AAF603B0; Fri, 26 Oct 2012 10:30:48 -0500 (CDT) Received: by aart.rice.edu (Postfix, from userid 18612) id 10F201002C2; Fri, 26 Oct 2012 10:30:49 -0500 (CDT) Date: Fri, 26 Oct 2012 10:30:49 -0500 From: "ktm@rice.edu" To: =?iso-8859-1?Q?B=F6ckler?= Andreas Cc: pgsql-performance@postgresql.org Subject: Re: Query-Planer from 6seconds TO DAYS Message-ID: <20121026153049.GC2872@aart.rice.edu> References: <20121025182226.306900@gmx.com> <20121026145513.GB2872@aart.rice.edu> <4818E807-E940-44F2-B10E-75038A82945C@boeckler.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <4818E807-E940-44F2-B10E-75038A82945C@boeckler.org> User-Agent: Mutt/1.5.20 (2009-12-10) Content-Transfer-Encoding: quoted-printable X-Pg-Spam-Score: -2.6 (--) X-Archive-Number: 201210/311 X-Sequence-Number: 48270 On Fri, Oct 26, 2012 at 05:15:05PM +0200, B=F6ckler Andreas wrote: > Hi Ken, >=20 > Am 26.10.2012 um 16:55 schrieb ktm@rice.edu: >=20 > > Hi Andy, > >=20 > > You have the sequential_page_cost =3D 1 which is better than or equal= to > > the random_page_cost in all of your examples. > > It sounds like you need > > a sequential_page_cost of 5, 10, 20 or more. >=20 > You're right it was sequential_page_cost =3D 1 because it's really irre= levant what I do here: > set random_page_cost=3D2; > set seq_page_cost=3D5; > '2012-05-01' AND '2012-08-30' -> NESTEDLOOP > '2012-04-01' AND '2012-08-30' -> SEQSCAN >=20 > a) there will be a point, where things will go bad=20 > this is like patching up a roof 'till you find the next hole instead o= f making it right at the beginning of construction process > b) they high seq costs might be true for that table (partition at 40gb)= , but not for the rest of the database=20 > Seqscan-Costs per table would be great. >=20 > Regards, >=20 > Andy >=20 Hi Andy, You can set them per tablespace. Maybe you could put the appropriate tabl= es that need the higher costing on the same one. Regards, Ken