Received: from localhost (unknown [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 543712E2EAD for ; Thu, 29 Nov 2007 12:43:00 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 92206-05 for ; Thu, 29 Nov 2007 12:42:54 -0400 (AST) Received: from tamriel.snowman.net (tamriel.snowman.net [72.66.115.51]) by postgresql.org (Postfix) with ESMTP id 39D9A2E2EA8 for ; Thu, 29 Nov 2007 12:42:54 -0400 (AST) Received: by tamriel.snowman.net (Postfix, from userid 1000) id 6ABD484134; Thu, 29 Nov 2007 11:42:53 -0500 (EST) Date: Thu, 29 Nov 2007 11:42:53 -0500 From: Stephen Frost To: Simon Riggs Cc: Tom Lane , Gregory Stark , Csaba Nagy , Bill Moran , pgsql-performance@postgresql.org Subject: Re: TB-sized databases Message-ID: <20071129164253.GK5031@tamriel.snowman.net> Mail-Followup-To: Simon Riggs , Tom Lane , Gregory Stark , Csaba Nagy , Bill Moran , pgsql-performance@postgresql.org References: <4544e0330711271218h56ce4cc3p280a9fefff24583d@mail.gmail.com> <1196197045.4246.1154.camel@ebony.site> <474CA2FA.2020201@laotraesquina.com.ar> <20071128082716.91bbad9c.wmoran@collaborativefusion.com> <1196257702.31315.6.camel@PCD12478> <1196270576.4246.1246.camel@ebony.site> <878x4hmfd4.fsf@oxford.xeocode.com> <13851.1196351131@sss.pgh.pa.us> <1196352866.4246.1304.camel@ebony.site> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="TWB/Y4ytXnYHhyjJ" Content-Disposition: inline In-Reply-To: <1196352866.4246.1304.camel@ebony.site> X-Editor: Vim http://www.vim.org/ X-Info: http://www.snowman.net X-Operating-System: Linux/2.6.22-2-amd64 (x86_64) X-Uptime: 11:31:23 up 59 days, 16:44, 20 users, load average: 0.30, 0.22, 0.15 User-Agent: Mutt/1.5.16 (2007-06-11) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200711/378 X-Sequence-Number: 27793 --TWB/Y4ytXnYHhyjJ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * Simon Riggs (simon@2ndquadrant.com) wrote: > On Thu, 2007-11-29 at 10:45 -0500, Tom Lane wrote: > > Given that this list spends all day every day discussing cases where the > > planner is wrong, I'd have to think that that's a bet I wouldn't take. >=20 > I think you have a point, but the alternative is often much worse.=20 I'm not convinced you've outlined the consequences of implementing a plan cost limit sufficiently. > If an SQL statement fails because of too high cost, we can investigate > the problem and re-submit. If a website slows down because somebody > allowed a very large query to execute then everybody is affected, not > just the person who ran the bad query. Either way the guy that ran the > query loses, but without constraints in place one guy can kill everybody > else also. It's entirely possible (likely even) that most of the users accessing a webpage are using the same queries and the same tables. If the estimates for those tables ends up changing enough that PG adjusts the plan cost to be above the plan cost limit then *all* of the users would be affected. The plan cost isn't going to change for just one user if it's the same query that a bunch of users are using. I'm not sure if handling the true 'rougue query' case with this limit would actually be a net improvment overall in a website-based situation. I could see it being useful to set a 'notice_on_high_cost_query' variable where someone working in a data warehouse situation would get a notice if the query he's hand-crafting has a very high cost (in which case he could ctrl-c it if he thinks something is wrong, rather than waiting 5 hours before realizing he forgot a join clause), but the website with the one rougue query run by one user seems a stretch. Thanks, Stephen --TWB/Y4ytXnYHhyjJ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQFHTuwNrzgMPqB3kigRAvCTAJ9pOdRQYBqzRM53vjwpXiMOf5yBfwCghM/d ur95/WD8krLq4sXiaJg+/rc= =1LMH -----END PGP SIGNATURE----- --TWB/Y4ytXnYHhyjJ--