I have a table with about 80 million records. I have added a new attribute (heigth_category) which I want to fill based on another attribute (heigth).
If the heigth is between 0 and 6, I want to fill the heigth_category attribute with 1.
UPDATE schema.table t1 SET heigth_category = '1'
WHERE heigth >= 0
AND heigth< 6;
This took about 13 hours. Is that normal for such a query?
The explain gives this:
Update on bomen t1 (cost=13353.34..1932816.30 rows=579346 width=316)
-> Bitmap Heap Scan on bomen t1 (cost=13353.34..1932816.30 rows=579346 width=316)
Recheck Cond: ((boom_hoogt >= 0::numeric) AND (boom_hoogt < 6::numeric))
-> Bitmap Index Scan on boom_hoogt_idx (cost=0.00..13208.50 rows=579346 width=0)
Index Cond: ((boom_hoogt >= 0::numeric) AND (boom_hoogt < 6::numeric))
I working with PostgreSQL 9.1.12