Re: inserting, index and no index - speed

Поиск
Список
Период
Сортировка
От zilch@home.se
Тема Re: inserting, index and no index - speed
Дата
Msg-id 20010611001109.B29684@loony
обсуждение исходный текст
Ответ на Re: inserting, index and no index - speed  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: inserting, index and no index - speed
Список pgsql-general
> You might try running the ten thousand inserts as a single transaction
> (do "begin" and "end" around them).

A HUGE difference (also completely took away the ID field (serial) having
only name):

Database vacuumed
pg: Trying 25000 inserts on index_with...
Time taken: 12 seconds

Database vacuumed
pg: Trying 25000 inserts on index_without...
Time taken: 12 seconds <--- MIGHT BE BACUASE OF FSYNC!? (fsyncing also for the previous run)

Database vacuumed
pg: Trying 30000 inserts on index_with...
Time taken: 15 seconds

Database vacuumed
pg: Trying 30000 inserts on index_without...
Time taken: 12 seconds

Database vacuumed
pg: Trying 35000 inserts on index_with...
Time taken: 21 seconds

Database vacuumed
pg: Trying 35000 inserts on index_without...
Time taken: 14 seconds

I can't believe what a difference that made. How can it make it faster by
putting it in a transaction? I thought that would make it slower. Like only
a 100th of the time.

Daniel Akerud

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

Предыдущее
От: zilch@home.se
Дата:
Сообщение: Re: inserting, index and no index - speed
Следующее
От: Tom Lane
Дата:
Сообщение: Re: inserting, index and no index - speed