Re: [h2] Updating all rows in a table.

2014-07-29 Thread Thomas Mueller
Hi,

What about using a joined table "variable_node_2", where you store changes
to the default values. At startup, truncate that table.

I guess you will get additional ideas if you ask at StackOverflow.com

Regards,
Thomas

On Tuesday, July 29, 2014, Dani Fernandez  wrote:

> We have a table containing approx. 500k entries. Each time our server is
> restarted we need to reset all the records, to do so we use a query like:
>
> UPDATE VARIABLE_NODE SET NODE_VALUE = DEFAULT_VALUE,
> SUPPRESSION_STATE=FALSE,
> SUPPRESSION_RELEASE_TIME=0,
> VALUE_TIMESTAMP = ?, PROCESS_TIMESTAMP = ?;
>
> Where DEFAULT_VALUE is a defined default value for each record. The two
> timestamps are a common value for all the records and represents the time
> the server was restarted. It is passed in a store procedure using JDBC.
>
> This update takes all in all, in a very fast machine, like 1 minute. It
> means that each time we restart our server we must wait one minute, at
> least, to be operative. This is acceptable but not optimum. Do you see any
> flaw in this approach or a better approach to update all the records in the
> database?
>
> I think the user of indexes here is pointless as we are updating all the
> records without filtering them.
>
> Any idea, comment is much welcomed.
>
> Daniel.
>
> --
> You received this message because you are subscribed to the Google Groups
> "H2 Database" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to h2-database+unsubscr...@googlegroups.com
> 
> .
> To post to this group, send email to h2-database@googlegroups.com
> .
> Visit this group at http://groups.google.com/group/h2-database.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To post to this group, send email to h2-database@googlegroups.com.
Visit this group at http://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.


[h2] Updating all rows in a table.

2014-07-29 Thread Dani Fernandez
We have a table containing approx. 500k entries. Each time our server is 
restarted we need to reset all the records, to do so we use a query like: 

UPDATE VARIABLE_NODE SET NODE_VALUE = DEFAULT_VALUE, 
SUPPRESSION_STATE=FALSE, 
SUPPRESSION_RELEASE_TIME=0, 
VALUE_TIMESTAMP = ?, PROCESS_TIMESTAMP = ?; 

Where DEFAULT_VALUE is a defined default value for each record. The two 
timestamps are a common value for all the records and represents the time 
the server was restarted. It is passed in a store procedure using JDBC. 

This update takes all in all, in a very fast machine, like 1 minute. It 
means that each time we restart our server we must wait one minute, at 
least, to be operative. This is acceptable but not optimum. Do you see any 
flaw in this approach or a better approach to update all the records in the 
database? 

I think the user of indexes here is pointless as we are updating all the 
records without filtering them. 

Any idea, comment is much welcomed. 

Daniel. 

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To post to this group, send email to h2-database@googlegroups.com.
Visit this group at http://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.