Received: from localhost (unknown [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id F18D92E0102; Thu, 29 Nov 2007 13:19:53 -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 64654-08; Thu, 29 Nov 2007 13:19:47 -0400 (AST) Received: from alexis.jtlnet.com (alexis.jtlnet.com [69.36.9.81]) by postgresql.org (Postfix) with ESMTP id BFF522E2F8D; Thu, 29 Nov 2007 13:19:46 -0400 (AST) Received: from [192.168.10.103] (cpe-075-177-131-108.nc.res.rr.com [::ffff:75.177.131.108]) (AUTH: PLAIN andrew@dunslane.net, TLS: TLSv1/SSLv3, 256bits, AES256-SHA) by alexis.jtlnet.com with esmtp; Thu, 29 Nov 2007 12:32:47 -0500 id 0007FC54.474EF7BF.00003006 Message-ID: <474EF4AE.8010405@dunslane.net> Date: Thu, 29 Nov 2007 12:19:42 -0500 From: Andrew Dunstan User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.8.0.12) Gecko/20071019 Fedora/1.0.9-3.fc6 pango-text SeaMonkey/1.0.9 MIME-Version: 1.0 To: "Joshua D. Drake" CC: Tom Lane , 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> <474EE992.2050209@commandprompt.com> In-Reply-To: <474EE992.2050209@commandprompt.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200711/131 X-Sequence-Number: 4664 Joshua D. Drake wrote: > >> 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. > > Joshua, you're not making much sense here. Tom is talking about partitioning and his analysis is correct *in the partitioning case* AFAICS. What basis do you have for saying he is not? cheers andrew