Subject | AW: [Firebird-Java] jabird / Select / Update |
---|---|
Author | Steffen Heil (Mailinglisten) |
Post date | 2012-11-20T21:08:50Z |
Hi
I need to atomically update ALL rows of a table or NONE.
If it IS really a difference, I could do my own update statement though.
We are using this during updates of our software that change database
content.
So that very code is usually only run once during the lifetime of the
database.
While I am happy with every performance optimization, I need to go for every
stability optimization.
That's why I was afraid that the jaybird driver would queue something up
here.
We could have as few as 10 rows and as much as millions of rows.
The update for huge databases may take a while, but it may never break.
We have several similar places that use code like the one posted.
One example is code that takes a plaintext password column and converts it
to linux-style sha512-salted-password hashes. While you can probably
implement sha512 within a stored procedure, we need to run that function
5000 times per plaintext password (which may be hundreds of thousands - and
we need to get finished in this century...
So, if I understood correctly, nothing is queued and I can expect the
pseudo-code I posted to work. (If I am wrong here, please correct me.)
Apart from that, thanks for the tips.
Best regards,
Steffen
[Non-text portions of this message have been removed]
> At the moment you call updateRow(), Jaybird will execute a query to updateBut that happens "in place", so nothing is queue or such?
> that row in Firebird (see the code in org.firebirdsql.jdbc.FBRowUpdater )
> You could go with the suggestion by the_a_rioch earlier today to use twobut it
> separate (Prepared)Statement objects. It is slightly more work for you,
> replaces the heuristics of the driver to update the right row with anexplicit
> query. Although performance and memory wise it will probably not make aWhile I understand the idea, that is not a way I can go.
> lot of difference.
I need to atomically update ALL rows of a table or NONE.
If it IS really a difference, I could do my own update statement though.
We are using this during updates of our software that change database
content.
So that very code is usually only run once during the lifetime of the
database.
While I am happy with every performance optimization, I need to go for every
stability optimization.
That's why I was afraid that the jaybird driver would queue something up
here.
We could have as few as 10 rows and as much as millions of rows.
The update for huge databases may take a while, but it may never break.
> Also, how complex is that modify() function ? can you re-write it in SQLand run on server instead with single SQL statement?
We have several similar places that use code like the one posted.
One example is code that takes a plaintext password column and converts it
to linux-style sha512-salted-password hashes. While you can probably
implement sha512 within a stored procedure, we need to run that function
5000 times per plaintext password (which may be hundreds of thousands - and
we need to get finished in this century...
So, if I understood correctly, nothing is queued and I can expect the
pseudo-code I posted to work. (If I am wrong here, please correct me.)
Apart from that, thanks for the tips.
Best regards,
Steffen
[Non-text portions of this message have been removed]