Received: from candle.pha.pa.us (candle.navpoint.com [162.33.245.46]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f4IGCBA55332 for ; Fri, 18 May 2001 12:12:11 -0400 (EDT) (envelope-from pgman@candle.pha.pa.us) Received: (from pgman@localhost) by candle.pha.pa.us (8.10.1/8.10.1) id f4IGC7U29140; Fri, 18 May 2001 12:12:07 -0400 (EDT) From: Bruce Momjian Message-Id: <200105181612.f4IGC7U29140@candle.pha.pa.us> Subject: Re: Cost limit. In-Reply-To: "from Shaun Thomas at May 18, 2001 10:55:54 am" To: Shaun Thomas Date: Fri, 18 May 2001 12:12:07 -0400 (EDT) CC: pgsql-admin@postgresql.org X-Mailer: ELM [version 2.4ME+ PL90 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Archive-Number: 200105/92 X-Sequence-Number: 1440 > Actually I was thinking of something to cut the query off at the pass. I > looked through the code, and it does a query plan and uses the one with > least cost. So, theoretically, I should be able to hack the code so that > it will refuse to execute a query if the best query plan has an estimated > cost of over 100,000 for example. > > Some kind of error like: "Query not executed due to detection of possible > cross product." > > Of course, I'd like to stay away from source hacks, besides It would be > nice to tune from postgresql.conf as a parameter like max_query_cost. > > The source is a bit spaghetti-ish, and I'm having a hard time following > some of the macros, typedefs and structs. I don't think I could add > a feature like this myself. I don't think our optimizer estimates are that accurate. -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 853-3000 + If your life is a hard drive, | 830 Blythe Avenue + Christ can be your backup. | Drexel Hill, Pennsylvania 19026