Skip site navigation (1) Skip section navigation (2)

Slow INSERT as compared to UPDATE

From: preetika tyagi <preetikatyagi(at)gmail(dot)com>
To: pgsql-students(at)postgresql(dot)org
Subject: Slow INSERT as compared to UPDATE
Date: 2011-03-15 19:49:46
Message-ID: (view raw, whole thread or download thread mbox)
Lists: 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?


pgsql-students by date

Next:From: preetika tyagiDate: 2011-03-21 04:59:33
Subject: query execution time
Previous:From: preetika tyagiDate: 2011-02-28 19:28:15
Subject: queries on different tables

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group