Re: How long should it take to insert 200,000 records?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: How long should it take to insert 200,000 records?
Дата
Msg-id 29362.1170817637@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: How long should it take to insert 200,000 records?  ("Karen Hill" <karen_hill22@yahoo.com>)
Список pgsql-performance
"Karen Hill" <karen_hill22@yahoo.com> writes:
> On Feb 5, 9:33 pm, t...@sss.pgh.pa.us (Tom Lane) wrote:
>> I think you have omitted a bunch of relevant facts.

> The postgres version is 8.2.1 on Windows.   The pl/pgsql function is
> inserting to an updatable view (basically two tables).
> [ sketch of schema ]

I think the problem is probably buried in the parts you left out.  Can
you show us the full schemas for those tables, as well as the rule
definition?  The plpgsql function itself can certainly go a lot faster
than what you indicated.  On my slowest active machine:

regression=# create table viewfoo(x int);
CREATE TABLE
regression=# CREATE OR REPLACE FUNCTION functionFoo() RETURNS VOID AS $$
BEGIN
FOR i in 1..200000 LOOP
INSERT INTO viewfoo (x) VALUES (i);
END LOOP;
END;
$$ LANGUAGE plpgsql;
CREATE FUNCTION
regression=# \timing
Timing is on.
regression=# select functionFoo();
 functionfoo
-------------

(1 row)

Time: 16939.667 ms
regression=#

            regards, tom lane

В списке pgsql-performance по дате отправления:

Предыдущее
От: Mark Kirkwood
Дата:
Сообщение: Re: How long should it take to insert 200,000 records?
Следующее
От: "Muruganantham M"
Дата:
Сообщение: Help Needed