X-Original-To: pgsql-patches-postgresql.org@postgresql.org Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id 596829F95E3 for ; Tue, 18 Jul 2006 16:46:40 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 74517-10 for ; Tue, 18 Jul 2006 19:46:36 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey- Received: from trolak.mydnsbox2.com (ns1.mydnsbox2.com [207.44.142.118]) by postgresql.org (Postfix) with ESMTP id 387319F94F3 for ; Tue, 18 Jul 2006 16:46:37 -0300 (ADT) Received: from [192.168.1.219] (68.143.134.146.nw.nuvox.net [68.143.134.146]) (authenticated (0 bits)) by trolak.mydnsbox2.com (8.11.6/8.11.6) with ESMTP id k6IJCl402978; Tue, 18 Jul 2006 14:12:48 -0500 Message-ID: <44BD3A98.2050702@dunslane.net> Date: Tue, 18 Jul 2006 15:46:32 -0400 From: Andrew Dunstan User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.13) Gecko/20060418 CentOS/1.7.13-1.4.1.centos4 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Chris Browne CC: pgsql-patches@postgresql.org Subject: Re: [HACKERS] 8.2 features? References: <44B69778.5050104@dunslane.net> <50461.84.63.113.55.1152832991.squirrel@pezone.net> <44B7ADFC.90205@dunslane.net> <44BC0432.3040509@joeconway.com> <44BC661F.80609@joeconway.com> <44BCD06C.3060409@calorieking.com> <60u05eagu8.fsf@dba2.int.libertyrms.com> In-Reply-To: <60u05eagu8.fsf@dba2.int.libertyrms.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200607/141 X-Sequence-Number: 20295 Chris Browne wrote: >chris.kings-lynne@calorieking.com (Christopher Kings-Lynne) writes: > > >>>The major downside is that somewhere between 9000 and 10000 >>>VALUES-targetlists produces "ERROR: stack depth limit >>>exceeded". Perhaps for the typical use-case this is sufficient >>>though. >>>I'm open to better ideas, comments, objections... >>> >>> >>If the use case is people running MySQL dumps, then there will be >>millions of values-targetlists in MySQL dumps. >> >> > >Curiosity: How do *does* TheirSQL parse that, and not have the One >Gigantic Query blow up their query parser? > > Experimentation shows that mysqldump breaks up the insert into chunks. Example with 10m rows: [ad@wired-219 ~]# perl -e 'print "drop table if exists foo; create table foo (x int);\n"; foreach my $i (0..9_9999) { print "insert into foo values \n"; foreach my $j (0..99) { print "," if $j; print "(",100*$i+$j+1,")"; } print ";\n"; } ' > gggggg [ad@wired-219 ~]# mysql test < gggggg [ad@wired-219 ~]# mysqldump test foo > aaaaaa [ad@wired-219 ~]# mysql test < aaaaaa [ad@wired-219 ~]# grep INSERT aaaaaa | wc -l 104 cheers andrew