First inserts are faster than second ones

Поиск
Список
Период
Сортировка
От AlannY
Тема First inserts are faster than second ones
Дата
Msg-id 6b5a9169c298317d55cd427f479bf724@imap.hc.ru
обсуждение исходный текст
Список pgsql-general
Hi there.

I have a strange behaviour about INSERT execution. I have very dummy
PL/pgSQL function, which SELECT data from table; if data exists - skip, if
not - add one. It's about 3'000'000 execution per program life.

Everything works. But there are one weird thing. After DROP TABLE and then
CREATE TABLE (CREATE INDEX), it's must faster to work for this function.
After initial INSERTs the speed of execution about 5 minutes. But,
transaction may fail. If it fail, I can change data and run this function
from the beginning. The second pass on the empty tables are much slower,
about 1,5 hours. So, I decide to DROP TABLE and CREATE it again and gain
much speedup.

Is it normal?

Thanks for patience.

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

Предыдущее
От: "Daniel Verite"
Дата:
Сообщение: Re: Comparison of Oracle and PostgreSQL full text search
Следующее
От: Gary Fu
Дата:
Сообщение: Re: psql problem