Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,637,620
Community Members
 
Community Events
196
Community Groups

Insight as large Asset Management has to have retention policy

Hello community, 

 

Today, I would like to share a small snippet sql request to cleanup Insight object histories. 

In the future, I will be happy to see the configuration in the Insight app as a retention policy. (Please, Atlassian provide retention policy feature in Insight)

 

We have 2mln+ objects in Insight, not so far, at the moment we do a cleanup and review existing potential weaknesses and improve performance of our Jira Service management DC setup. 

Once our web navigation Insight tab was slow, If we do cleanup of history it starting to be fast then do review of records. 

image.png

Every night our system syncs up with SAP, IdP and other external systems, also, event based sync up and updates objects from remote systems. 

Therefore potential weakness is duplicated history, because change log we don’t need to keep longer than 3 months, as change log keeps on master systems. 

Also, the next query helpful to find misconfigs. 

SELECT hist."ID",
hist."AFFECTED_ATTRIBUTE",
count(hist."ID") updates
FROM "AO_8542F1_IFJ_OBJ_HIST" hist
GROUP BY hist."ID", hist."AFFECTED_ATTRIBUTE"
ORDER BY updates DESC;

image.png


You can find here the query in git. 

 

As a technique, I just remove via next query, of course, it’s useful. 

SELECT count("ID")
FROM "AO_8542F1_IFJ_OBJ_HIST" hist
WHERE
"CREATED" < NOW() - INTERVAL '3 months' ;

Then if scope is quite ok, you can replace select into delete to delete rows. 

Please, do before on test env, if you don’t understand the purpose and please, do backup.

Detailed info you can find here.



Please, Atlassian provide to us in Insight app the retention policy of history records. It helps to easily work with navigation in the Insight tab. 

Have a good cleanup.

Cheers,

Gonchik Tsymzhitov

1 comment

Gonchik, hello! 

Thanks for this article. We also often need to clear Insight history records from DB. So it would be great to performe cleanup from the GUI.

Like Gonchik Tsymzhitov likes this

Comment

Log in or Sign up to comment
TAGS
AUG Leaders

Atlassian Community Events