pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andrew Dunstan <andrew@dunslane.net>
To: Chris Browne <cbbrowne@acm.org>
Cc: pgsql-patches@postgresql.org
Subject: Re: [HACKERS] 8.2 features?
Date: Tue, 18 Jul 2006 15:46:32 -0400
Message-ID: <44BD3A98.2050702@dunslane.net> (raw)
In-Reply-To: <60u05eagu8.fsf@dba2.int.libertyrms.com>
References: <44B69778.5050104@dunslane.net>
	<50461.84.63.113.55.1152832991.squirrel@pezone.net>
	<ECCAAC0A3182895D3D12B0E8@[172.26.14.247]>
	<44B7ADFC.90205@dunslane.net>
	<44BC0432.3040509@joeconway.com>
	<44BC661F.80609@joeconway.com>
	<44BCD06C.3060409@calorieking.com>
	<60u05eagu8.fsf@dba2.int.libertyrms.com>

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







view thread (56+ messages)  latest in thread

Message-ID: <44BD3A98.2050702@dunslane.net>
Permalink:  ../44BD3A98.2050702@dunslane.net/
Also on:    postgresql.org/message-id/44BD3A98.2050702@dunslane.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-docs@postgresql.org
  Cc: andrew@dunslane.net, cbbrowne@acm.org, pgsql-patches@postgresql.org
  Subject: Re: [HACKERS] 8.2 features?
  In-Reply-To: <44BD3A98.2050702@dunslane.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox