What are the Slack Archives?

Itโ€™s a history of our time together in the Slack Community! Thereโ€™s a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.

Because this space is not active, you wonโ€™t be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..

hi there, `spy_oms_order_item_state_history` and `spy_oms_transition_log` are the biggest tables in

UKK0LRJ6A
UKK0LRJ6A Posts: 14 ๐Ÿง‘๐Ÿปโ€๐Ÿš€ - Cadet
edited February 2021 in Slack General

hi there,

spy_oms_order_item_state_history and spy_oms_transition_log are the biggest tables in our database. Is it safe + is it ok to remove old entries from both tables?

e.g. with:

DELETE FROM
    spy_oms_transition_log
WHERE
    created_at < CURRENT_DATE - interval '90' day;

Comments

  • Ehsan Zanjani
    Ehsan Zanjani Head of Solution Architecture @ Spryker Sprykee Posts: 113 ๐Ÿง‘๐Ÿปโ€๐Ÿš€ - Cadet
    edited February 2021

    Hey @UKK0LRJ6A
    I think OrderDetail page is using the state-history table to show the order items with status history, so if you delete them you wonโ€™t see order items, this can be fixed by changing the join type from inner to left in one of the query, I donโ€™t remember it honestly. ๐Ÿ™‚
    Transition logs are stored in DB just for debugging reason in OMS, so if you donโ€™t have any issue with old orders feel free to remove them!

  • Ehsan Zanjani
    Ehsan Zanjani Head of Solution Architecture @ Spryker Sprykee Posts: 113 ๐Ÿง‘๐Ÿปโ€๐Ÿš€ - Cadet

    Also please donโ€™t delete the old orders without any track back, you can export them to an archive storage

  • UKK0LRJ6A
    UKK0LRJ6A Posts: 14 ๐Ÿง‘๐Ÿปโ€๐Ÿš€ - Cadet

    thanks @UK9N7MP96! is there already a public extension to move old orders into a archive storage?

  • Ehsan Zanjani
    Ehsan Zanjani Head of Solution Architecture @ Spryker Sprykee Posts: 113 ๐Ÿง‘๐Ÿปโ€๐Ÿš€ - Cadet
    edited February 2021

    You can just easily export a dump and extract it into a different DB (off production), nothing specials and it could also be a monthly script/job

  • UKK0LRJ6A
    UKK0LRJ6A Posts: 14 ๐Ÿง‘๐Ÿปโ€๐Ÿš€ - Cadet

    thanks!