Calling Developers!
We are reenergizing our code contribution process! Learn More

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 Team, Do you have any idea about how to check data in mirror table in DB? Please let me know if

Options
U03BC5A43CL
U03BC5A43CL Posts: 15 🧑🏻‍🚀 - Cadet
edited June 2022 in Slack General

Hi Team,

Do you have any idea about how to check data in mirror table in DB?

Please let me know if you have any idea about this.

Thanks in advance

Comments

  • fsmeier
    fsmeier Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,018 ⚖️ - Guardians (admin)
    Options

    Hey, what kind of data and what do you mean with “mirror table”? - And what do you mean with “check” ? Just visually?

  • Alberto Reyer
    Alberto Reyer Lead Spryker Solution Architect / Technical Director Posts: 690 🪐 - Explorer
    edited June 2022
    Options

    I assume you want to compare two tables with the same structure if one of the table is missing an entry that the other one has:

    SELECT 
    table_a.field_1, 
    table_b.field_1 
    FROM table_a 
    FULL OUTER JOIN table_b ON table_a.id = table_b.id
     WHERE table_a.field_1 IS NULL OR table_b.field_1 IS NULL
    
    that would give you all entries that only exist in one of the tables.
    

    Please be aware that these will do a full table scan on both tables, so it's performance sensitive and should not be executed on large tables in a production system.

  • U0208K3V15W
    U0208K3V15W Posts: 33 🧑🏻‍🚀 - Cadet
    edited June 2022
    Options

    You can using cron job to count number record in ''mirror table" and compare with "entries table"