My changeitem table now consumes over 50 percent of my database and it is growing, currently it is 19g on a 30g database with 500 issues. Most of the entries are due builds and interaction with SCM systems. What can i do
1) remove items periodically from change table.
2) limit the number of changeitems kept per issue.
Removing the data destroys the information about changes, so you need to think very carefully before you do this.
The only way to do it without coding is to use SQL directly to kill the lines you decide you don't want. As you specify builds and SCM interactions, I'd attack them first. Identify the patterns, work out a decent rule for them, and remove the lines in SQL. However, you will also need to remove lines from changeGROUP for consistency - removing any changegroup lines that no longer contain any changeitems.
When you run the SQL for the two tables, you absolutely MUST backup the database, have Jira offline, and reindex as soon as you restart Jira.
As for point 2 - you can't. There's no limitations in Jira, it just keeps tracking changes.
you will also need to remove lines from changeGROUP for consistency - removing any changegroup lines that no longer contain any changeitems
those who interested, PostgreSQL snippet to delete change groups that don't have change items
-- WARNING! DO NOT APPLY FOR PROD INSTANCE!
DELETEFROM
changegroup
WHERE
ID =
any
(
ARRAY(
SELECT
G.id
FROM
changegroup G
LEFT
JOIN
changeitem I
ON
I.groupid = G.id
WHERE
I.groupid
IS
NULL
)
);
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
DO NOT DO THAT.
There are items in changegroup that have no items for very good reasons. You are damaging your data.
Please, restore your data from the backup you took before doing this and don't ever do it again.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
There are items in changegroup that have no items for very good reasons.
Nic Brough, any example of such entries? Checked on a large enough prod JIRA instance and didn't find any Change groups without Change items.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes.
Why are you removing them?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Why are you removing them?
In my case it was for partly anonymized staging (copy of prod) instance.
But generally I added the snippet for those who trying to do this:
you will also need to remove lines from changeGROUP for consistency - removing any changegroup lines that no longer contain any changeitems
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ok, you're going about "anonymising" it in a broken way. You should never delete this stuff, just change it so it's not identifiable.
Please, step away from the database, you could be doing all sorts of damage by doing things you don't understand.
For anonymisation, do it the correct way - see https://confluence.atlassian.com/jira/anonymising-jira-data-139008.html
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Atlassian Government Cloud has achieved FedRAMP Authorization at the Moderate level! Join our webinar to learn how you can accelerate mission success and move work forward faster in cloud, all while ensuring your critical data is secure.
Register NowOnline forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.