Re: [HACKERS] 8.2 features? - Mailing list pgsql-patches

From Andrew Dunstan
Subject Re: [HACKERS] 8.2 features?
Date
Msg-id 44BD3A98.2050702@dunslane.net
Whole thread Raw
In response to Re: [HACKERS] 8.2 features?  (Chris Browne <cbbrowne@acm.org>)
List pgsql-patches
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





pgsql-patches by date:

Previous
From: Chris Browne
Date:
Subject: Re: [HACKERS] 8.2 features?
Next
From: Zdenek Kotala
Date:
Subject: Mark change-on-restart-only values in postgresql.conf