Slow INSERT as compared to UPDATE

Поиск
Список
Период
Сортировка
От preetika tyagi
Тема Slow INSERT as compared to UPDATE
Дата
Msg-id AANLkTikLMpW4W=N4t8SVsN366jY22VDyOgzpQmFqK6bc@mail.gmail.com
обсуждение исходный текст
Список pgsql-students
Hi All,

When I insert or update a record in a table in PostgreSQL, the time taken by insert query is much larger (300 ms) than the time taken by update query (20 ms). If I think logically, there should not be a significant difference. To insert a record, it will check/insert the entry in the index and insert the record in the table (unclustered B Tree indexing on primary key). For update, it will search the entry in the indexing and update the record. In both the cases, the number of operations/disk accesses are nearly equal. Then why such a big execution time difference?

Thanks,
Preetika

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

Предыдущее
От: preetika tyagi
Дата:
Сообщение: queries on different tables
Следующее
От: preetika tyagi
Дата:
Сообщение: query execution time