| From: | zilch(at)home(dot)se |
|---|---|
| To: | pgsql-general(at)postgresql(dot)org |
| Subject: | Re: inserting, index and no index - speed |
| Date: | 2001-06-10 22:11:09 |
| Message-ID: | 20010611001109.B29684@loony |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | 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
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Tom Lane | 2001-06-10 22:41:12 | Re: inserting, index and no index - speed |
| Previous Message | zilch | 2001-06-10 21:56:15 | Re: inserting, index and no index - speed |