• Julien Muchembled's avatar
    mysql: do not use unsafe TRUNCATE statement · c3c2ffe2
    Julien Muchembled authored
    TRUNCATE was chosen for performance reasons, but it's usually done on small
    tables, and not for performance-critical operations. TRUNCATE commits
    implicitely, so for pt/ttrans in particular, it's certainly slower due to extra
    fsyncs to disk.
    
    On the other side, committing too early can corrupt the database if the storage
    node is stopped just after. For example, a failure in changePartitionTable()
    can cause 'pt' to remain empty.
    c3c2ffe2
mysqldb.py 31.4 KB