cdo_commit_infos table cleanup [message #1859709] |
Fri, 23 June 2023 04:55 |
I S Messages: 22 Registered: May 2022 |
Junior Member |
|
|
Hi,
I have a cdo_commit_infos table which is too big, it has about 40 000 000 records. When I start my application, I see the following query in psql which is executing for a few minutes:
SELECT commit_time, branch_id, user_id, comment FROM cdo_commit_infos;
I have two questions:
1. What is the purpose of the cdo_commit_infos table?
2. Can I clean up the table using delete from cdo_commit_infos where user_id is null;
This query leaves a single record in the table which has "<initialize root resource>" comment and my application starts without delays but I'm not sure about long-term consequences of this.
The version of CDO I'm currently using is 3.0.1, at this moment I can't upgrade it to the latest one.
Also, I don't use any custom commit info handlers.
Thanks!
[Updated on: Fri, 23 June 2023 05:01] Report message to a moderator
|
|
|
Re: cdo_commit_infos table cleanup [message #1859710 is a reply to message #1859709] |
Fri, 23 June 2023 05:37 |
|
CDO 3.0.1 is 13 years old. I'm not sure how it will behave without this table or with an empty commit info table. Possible that this old CDO version does not even start without this table, or that it complains when you start using certain functions such as the History view or others.
In newer 4.x versions you can prevent this table from being created at server start by adding this to your cdo-server.xml:
<property name="commitInfoStorage" value="NO"/>
But even here it mostly depends on what functions of CDO you'll be using.
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
|
|
|
|
|
Re: cdo_commit_infos table cleanup [message #1871106 is a reply to message #1859741] |
Mon, 16 September 2024 06:56 |
I S Messages: 22 Registered: May 2022 |
Junior Member |
|
|
Hi Eike,
Finally I was able to upgrade CDO from 3.0 to 2024.06 and I got rid of cdo_commit_infos table. Unfortunately, I used this table in my code to get the last commit time. I need this time for some syncing stuff and queried cdo_commit_infos every two minutes. So my question is how can I get the last commit time from CDO server or using another approach? I searched in CDO source code and found org.eclipse.emf.cdo.server.internal.db.DBStore#repairAfterCrash method which retrieves the last commit time but seems it checks every single table (I want to use the same approach for now if I won't find anything better). I have around 550 tables with million records in some of them and I'm afraid this approach might get my CDO server down (but probably it would be fast enough having correct indexes). However, there is a comment in the CDO source code that probably points to the right direction for me but I don't understand what it exactly means.
Quote:
long lastCommitTime = CDOBranchPoint.UNSPECIFIED_DATE;
long lastNonLocalCommitTime = CDOBranchPoint.UNSPECIFIED_DATE;
// Unfortunately the package registry is still inactive, so the class mappings can not be used at this point.
// Use all tables with a "CDO_CREATED" field instead.
for (String tableName : DBUtil.getAllTableNames(connection, schemaName, caseSensitive))
{
// search for the last commit time
}
I guess the package registry is active when my application is fully started. Do you have an idea or a hint how to use it to get the last commit time without cdo_commit_infos table with one shot whithout querying every single table in the DB?
Thanks,
Ivan.
[Updated on: Mon, 16 September 2024 07:22] Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.04065 seconds