X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (neptune.hub.org [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 0AABAD1B456 for ; Thu, 11 Dec 2003 20:28:50 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 06229-05 for ; Thu, 11 Dec 2003 16:28:20 -0400 (AST) Received: from wolff.to (wolff.to [66.93.249.74]) by svr1.postgresql.org (Postfix) with SMTP id CA045D1D0AE for ; Thu, 11 Dec 2003 16:28:17 -0400 (AST) Received: (qmail 10562 invoked by uid 500); 11 Dec 2003 20:27:55 -0000 Date: Thu, 11 Dec 2003 14:27:55 -0600 From: Bruno Wolff III To: sandra ruiz Cc: pgsql-performance@postgresql.org Subject: Re: hints in Postgres? Message-ID: <20031211202755.GB9844@wolff.to> Mail-Followup-To: sandra ruiz , pgsql-performance@postgresql.org References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.4i X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200312/184 X-Sequence-Number: 5044 On Thu, Dec 11, 2003 at 11:00:19 -0500, sandra ruiz wrote: > Hi list, > > I need to know if there is anything like hints of Oracle in > Postgres..otherwise..I wish to find a way to force a query plan to use the > indexes or tell the optimizer things like "optimize based in statistics", > "I want to define the order of the a join" , "optimize based on a execution > plan that I consider the best" ... There are a few things you can do. You can explicitly fix the join order using INNER JOIN (in 7.4 you have to set a GUC variable for this to force join order). You can disable specific plan types (though sequential just becomes very expensive as sometimes there is no other way to do things). You can set tuning values to properly express the relative cost of things like CPU time, sequential disk reads and random disk reads. These are done by setting GUC variables either in the postgres config file or using SET commands. They are per backend so some queries can be done using one set of values while others going on at the same time use different values.