Re: For loop - Mailing list pgsql-sql

From Alvaro Herrera
Subject Re: For loop
Date
Msg-id 20070313142744.GA7548@alvh.no-ip.org
Whole thread Raw
In response to Re: For loop  ("Ezequias R. da Rocha" <ezequias@fastcon.com.br>)
Responses Re: For loop  ("Ezequias R. da Rocha" <ezequias@fastcon.com.br>)
List pgsql-sql
Ezequias R. da Rocha wrote:
> Thank you all. The function from Jonah solves my problem.
> 
> Just a simple question:
> 
> One million of inserctions in *28,8* seconds with this kind of data 
> (timestamp|character varring (50))  is a good performance ?
> 
> I let my questions to DBAs from PostgreSQL.

I don't know, but Jonah's function can be better written using pure SQL,
which should be faster.  Something like this:

create table whatever (a text, b int);
insert into whatever select 'My text from iteration ' || a, a * 2 from generate_series(1, 1000000) a;

I don't claim this works as is, but you should get the hang of it.

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support


pgsql-sql by date:

Previous
From: "Ezequias R. da Rocha"
Date:
Subject: Re: For loop
Next
From: "Ezequias R. da Rocha"
Date:
Subject: Re: For loop