Skip to content
This repository has been archived by the owner on Apr 2, 2024. It is now read-only.

Decrease the time locks are held during duplicate copy #1696

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Oct 14, 2022

  1. Decrease the time locks are held during duplicate copy

    This commit changes the order of operations from:
    COPY to temp_metric1
    INSERT from temp_metric_1 to metric_1 ON CONFLICT DO NOTHING
    COPY to temp_metric2
    INSERT from temp_metric_2 to metric_2 ON CONFLICT DO NOTHING
    
    to
    
    COPY to temp_metric1
    COPY to temp_metric2
    INSERT from temp_metric_1 to metric_1 ON CONFLICT DO NOTHING
    INSERT from temp_metric_2 to metric_2 ON CONFLICT DO NOTHING
    
    By combining the inserts together at the end of the transaction
    it decreases the times that locks on conflicting rows are held.
    cevian committed Oct 14, 2022
    Configuration menu
    Copy the full SHA
    0ad2f76 View commit details
    Browse the repository at this point in the history