-
1. Re: Envers performance with huge audit tables
adamw Jan 5, 2011 10:21 AM (in response to cheaway)1 of 1 people found this helpfulHello,
not sure which version of Envers you are using, but maybe you can try using the ValidityAuditStrategy (present from 3.6).
Also, see: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5371
Adam
-
2. Re: Envers performance with huge audit tables
cheaway Jan 6, 2011 4:46 AM (in response to adamw)Hi Adam,
Thanks for your response, this does indeed sound like what I need.
Do you know if it is possible to switch the AuditStrategy on a table that already contains entries? What would happen to my data in that table?
Che
-
3. Re: Envers performance with huge audit tables
adamw Jan 11, 2011 2:43 PM (in response to cheaway)Hello,
yes, it's possible. Of course you won't loose any date, you will just need to appropriately fill in the "REVEND" column. This can be done with either an SQL script or a simple script - I think Erik has one somewhere, or was it maybe in the JIRA?
Adam
-
4. Envers performance with huge audit tables
cheaway Feb 7, 2011 10:20 AM (in response to adamw)Hi Adam,
Back after a long 'vacation' (the birth of my child), I thought I might ask if you were able to find the SQL somehwere?
I think it would be good to use the existing solution so I know that the code works...
Thanks in advance,
Che
-
5. Envers performance with huge audit tables
adamw Feb 9, 2011 1:43 AM (in response to cheaway)No unfortunately I haven't run by it - try searching the forums. Or writing them yourself, I really think they should be easy.
Btw, congratulations! I had a similar vacation not long ago (well, it's 8 months now, time flies quickly).
Adam
-
6. Envers performance with huge audit tables
cheaway Feb 9, 2011 2:25 AM (in response to adamw)Thanks for the quick reply, I'll try searching the forum again and otherwise indeed just write the statements myself...
Che
P.S.: Time does fly - I cannot believe that my son is almost a month old already!!
-
7. Envers performance with huge audit tables
cheaway Feb 10, 2011 2:15 AM (in response to cheaway)For completeness, this probably is what Adam meant:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-5721
Unfortunately, they are perl scripts (I don't know about the status of the ant task) and they expect you to have a valid schema already...
-
8. Envers performance with huge audit tables
adamw Feb 11, 2011 2:29 AM (in response to cheaway)Ah yes, this could be it
Let me know how the migration went for you.
Adam
-
9. Re: Envers performance with huge audit tables
cheaway Feb 25, 2011 2:57 AM (in response to adamw)Unfortunately, the perl scripts turned out to be useless when migrating the database. I am dealing with audition tables with 50.000.000 records and the perl scripts attempt to load everything in memory before proceeding. Also, the scripts do not seem to fill the REVEND_TSTMP field, but that might just be an artifact of the memory overflows that I experienced.
Eventually, I wrote my own Java class that does the migration for me on a per-row basis and also does some caching magic for performance purposes. Still, a full migration takes around 5 hours with the huge tables...
Anyway, all is good now, so thanks a lot for you help.
Cheers,
Che