vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Hello, postgresql 8.0.1, in a plpgsql function To update columns' values in a table (without OID), if I ran: 1. "update table1 set col1 = ..., col2 = ... ... col100 =" or 2. "update table1 set col1 = " .... "update table1 set col100 = " way 1 only has one disk I/O, right? While way 2 is more time consuming since there is disk I/O when a update is ran. Thanks a lot, Ying ---------------------------(end of broadcast)--------------------------- TIP 4: Have you searched our list archives? http://archives.postgresql.org |
| |||
| am 10.03.2006, um 10:46:39 -0500 mailte Emi Lu folgendes: > Hello, > > postgresql 8.0.1, in a plpgsql function > > To update columns' values in a table (without OID), if I ran: > 1. "update table1 set col1 = ..., col2 = ... ... col100 =" > > or > 2. > "update table1 set col1 = " > ... > "update table1 set col100 = " > > way 1 only has one disk I/O, right? While way 2 is more time consuming > since there is disk I/O when a update is ran. Because of MVCC every UPDATE is practical a DELETE + INSERT. Way1: you have only one DELETE+INSERT, Way2 one hundred, and you have 100 dead rows until the next VACUUM. HTH, Andreas -- Andreas Kretschmer (Kontakt: siehe Header) Heynitz: 035242/47215, D1: 0160/7141639 GnuPG-ID 0x3FFF606C http://wwwkeys.de.pgp.net === Schollglas Unternehmensgruppe === ---------------------------(end of broadcast)--------------------------- TIP 5: don't forget to increase your free space map settings |
| ||||
| Thanks Andreas. That was a quick response. So way 1 must be quicker. >am 10.03.2006, um 10:46:39 -0500 mailte Emi Lu folgendes: > > >>Hello, >> >>postgresql 8.0.1, in a plpgsql function >> >>To update columns' values in a table (without OID), if I ran: >>1. "update table1 set col1 = ..., col2 = ... ... col100 =" >> >>or >>2. >>"update table1 set col1 = " >>... >>"update table1 set col100 = " >> >>way 1 only has one disk I/O, right? While way 2 is more time consuming >>since there is disk I/O when a update is ran. >> >> > >Because of MVCC every UPDATE is practical a DELETE + INSERT. >Way1: you have only one DELETE+INSERT, Way2 one hundred, and you have >100 dead rows until the next VACUUM. > > >HTH, Andreas > > ---------------------------(end of broadcast)--------------------------- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to majordomo@postgresql.org so that your message can get through to the mailing list cleanly |