Search Postgresql Archives

Re: Alternative to UPDATE (As COPY to INSERT)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 23/02/10 09:26, Yan Cheng CHEOK wrote:
I realize update operation speed in PostgreSQL doesn't meet my speed expectation.

Is there any fast alternative to UPDATE? as using fast COPY to INSERT operation.

No. But you haven't said where the limit is on your operation.
         EXECUTE 'UPDATE statistic SET value = $1 WHERE fk_lot_id = $2 AND measurement_type = $3 AND statistic_type = $4'
         USING _values[i], _lotID, _measurementTypes[i], _statisticTypes[i];

There's no need to do EXECUTE ... USING here - just do the update
  UPDATE statistic SET value = _values[i] WHERE fk_log_id = _lotID ...

It takes around 20ms :(

I am expecting<  1ms

This might be impractical, depending on exactly what you hope to achieve.

If you wish to have individual transactions take no more than 1ms and be safely on disk, then you will need a disk controller with battery-backed write cache. Disks just don't spin fast enough.

You posted a few questions, but I don't see anything saying exactly what you are trying to achieve and what sort of server you have to do it with. Perhaps some background would be useful.

--
  Richard Huxton
  Archonet Ltd

--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux