Received: from localhost (unknown [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id 9EFC72E3C57; Thu, 29 Nov 2007 12:35:36 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-maia, port 10024) with ESMTP id 09162-03-2; Thu, 29 Nov 2007 12:35:28 -0400 (AST) Received: from lists.commandprompt.com (host-159.commandprompt.net [207.173.203.159]) by postgresql.org (Postfix) with ESMTP id 029C52E3C69; Thu, 29 Nov 2007 12:32:26 -0400 (AST) Received: from [192.168.1.4] (or-69-34-217-90.sta.embarqhsd.net [69.34.217.90]) (authenticated bits=0) by lists.commandprompt.com (8.13.8/8.13.8) with ESMTP id lATGWAfI002603 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 29 Nov 2007 08:32:11 -0800 Message-ID: <474EE992.2050209@commandprompt.com> Date: Thu, 29 Nov 2007 08:32:18 -0800 From: "Joshua D. Drake" Organization: Command Prompt, Inc. User-Agent: Thunderbird 1.5.0.13 (Windows/20070809) MIME-Version: 1.0 To: Tom Lane CC: Michael Paesold , NikhilS , David Fetter , "Jonah H. Harris" , PostgreSQL Docs , PostgreSQL Patches Subject: Re: [PATCHES] Partition: use triggers instead of rules References: <20071128202615.GG24146@fetter.org> <21686.1196283184@sss.pgh.pa.us> <36e682920711281858x9a37039sa104036bf025de41@mail.gmail.com> <20071129031702.GU24146@fetter.org> <2854.1196315753@sss.pgh.pa.us> <20071128224154.06f950c9@commandprompt.com> <474EDAE2.3010705@gmx.at> <474EE25E.3080304@commandprompt.com> <14455.1196353045@sss.pgh.pa.us> In-Reply-To: <14455.1196353045@sss.pgh.pa.us> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0 (lists.commandprompt.com [207.173.203.159]); Thu, 29 Nov 2007 08:32:11 -0800 (PST) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200711/126 X-Sequence-Number: 4659 Tom Lane wrote: > "Joshua D. Drake" writes: >> Rules are extremely slow in comparisons and not anywhere near as >> flexible. As I said up post yesterday... they work well in the basic >> partitioning configuration but anything else they are extremely deficient. > > I think that the above claim is exceedingly narrow-minded. We are talking about partitioning. It is supposed to be narrow-minded. > A trigger > will probably beat a rule for inserts/updates involving a small number > of rows. Which is exactly what partitioning is doing. For large numbers of rows, like an INSERT/SELECT from another > large table, the rule is likely to win, because its overhead is paid > once per query not once per row. Also, if you implement the trigger > with an EXECUTE (forcing a planning cycle) intead of hard-coded > commands, the speed advantage becomes even more dubious. Not for partitioning. Although I agree with your sentiments for normal operation. Sincerely, Joshua D. Drake