| From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
|---|---|
| To: | "Radovan Antloga" <radovan(dot)antloga(at)siol(dot)net> |
| Cc: | pgsql-performance(at)postgresql(dot)org |
| Subject: | Re: Performance decrease |
| Date: | 2006-04-20 15:41:41 |
| Message-ID: | 18973.1145547701@sss.pgh.pa.us |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers pgsql-performance |
"Radovan Antloga" <radovan(dot)antloga(at)siol(dot)net> writes:
> My test table has 15830 records with 190 fields.
190 fields in a table seems like rather a lot ... is that actually
representative of your intended applications?
> I do like this:
> update table
> set field = null
Again, is that representative of something you'll be doing a lot in
practice? Most apps don't often update every row of a table, in my
experience.
> After first execute I get time 3 seconds. Then I repeat
> this update. After each update time increase. I get
> 4 sec, 7 sec, 10 sec, 12 sec, 15 sec, 18 sec, 21 sec.
There should be some increase because of the addition of dead rows,
but both the original 3 seconds and the rate of increase seem awfully
high for such a small table. What are you running this on?
For comparison purposes, here's what I see on a full-table UPDATE
of a 10000-row table on a rather slow HP box:
regression=# \timing
Timing is on.
regression=# create table t1 as select * from tenk1;
SELECT
Time: 1274.213 ms
regression=# update t1 set unique2 = null;
UPDATE 10000
Time: 565.664 ms
regression=# update t1 set unique2 = null;
UPDATE 10000
Time: 589.839 ms
regression=# update t1 set unique2 = null;
UPDATE 10000
Time: 593.735 ms
regression=# update t1 set unique2 = null;
UPDATE 10000
Time: 615.575 ms
regression=# update t1 set unique2 = null;
UPDATE 10000
Time: 755.456 ms
regression=#
Vacuuming brings the time back down:
regression=# vacuum t1;
VACUUM
Time: 242.406 ms
regression=# update t1 set unique2 = null;
UPDATE 10000
Time: 458.028 ms
regression=#
regards, tom lane
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Martijn van Oosterhout | 2006-04-20 15:48:05 | Re: Google SoC--Idea Request |
| Previous Message | Gevik Babakhani | 2006-04-20 15:40:55 | TODO item pg_hba.conf |
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Merlin Moncure | 2006-04-20 16:05:02 | Re: Takes too long to fetch the data from database |
| Previous Message | Radovan Antloga | 2006-04-20 15:20:56 | Performance decrease |