Received: from sss.pgh.pa.us (sss.pgh.pa.us [216.151.103.158]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f4IGM6A60620 for ; Fri, 18 May 2001 12:22:06 -0400 (EDT) (envelope-from tgl@sss.pgh.pa.us) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.11.3/8.11.3) with ESMTP id f4IGLmR19870; Fri, 18 May 2001 12:21:48 -0400 (EDT) To: Shaun Thomas cc: pgsql-admin@postgresql.org Subject: Re: Cost limit. In-reply-to: References: Comments: In-reply-to Shaun Thomas message dated "Thu, 17 May 2001 15:57:29 -0500" Date: Fri, 18 May 2001 12:21:47 -0400 Message-ID: <19867.990202907@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200105/95 X-Sequence-Number: 1443 Shaun Thomas writes: > I can't seem to find it in the docs, so I'll ask here. Is there a > way in postgres to impose a limit on query costs? I'd noticed some > horribly disfigured queries hitting my poor database from one of our > developers, and corrected him. But many of our users are not so > easily contacted. What I want to know is if there's a configuration > parameter or source patch that will allow me to disallow a query > execution if the pre-execution cost estimation is too high. Given the inherent inaccuracy of the cost estimates, I'd be real hesitant to rely on them to suppress overly-expensive queries. What might make sense is a time limit on execution (after x amount of time, give up and cancel the query). No one's put such a thing into the backend AFAIK. Note you could implement such a time limit purely on the client side, which might be an easier and more flexible way to go. regards, tom lane