The computed column is literally calculated whenever page data is
written to disk i.e. whenever an INSERT or UPDATE or similar query is
executed.
So, no, we don't calculate the data when doing an "alter table add column".
On 2012-04-13 08:04, JND wrote:
Nope, it's very fast in terms of what I wrote: “If I then add a
computed column to that table, for example a computed column that
selects on a related table (using PK), the 'alter table' takes
[merely] a few seconds.” This is based on my understanding that the
values are calculated upon ADD COLUMN. If you’re saying that the
values are instead calculated on the fly (not during ADD COLUMN) then
it’s different than the documentation. The performance problem only
occurs with INSERT and MERGE. I’ll work on the profiling and bug
report when I get the chance.
On Friday, April 13, 2012 1:54:03 PM UTC+8, Noel Grandin wrote:
Read the bit about "the value is calculated before storing"
Thats why your inserts are slow.
--
--
You received this message because you are subscribed to the Google Groups "H2
Database" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/h2-database?hl=en.