ABC | 2013-04-06 | 2013-04-06 |8
ABC | 2013-04-07 | 2013-04-07 | 10
ABC | 2013-04-08 | 2013-04-07 |8
ABC | 2013-04-09 | 2013-04-07 |7
Akihiro Okuno
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
How about separating count query from update statement.
I found a bit performance improvement from your example.
with 10 rows, fastest time in 10 times try
yours: 989.679 ms
mine: 719.739 ms
query
---
(same DDL, DML)
WITH cnt AS (
SELECT
count(CASE WHEN tab1.a >= 60 THEN 1 EN