The benefits of sharding

  • Saves the time of full table scan

    Divide the 1GB table into 10 sub-tables with 100MB each. If it takes 100 seconds to scan 1GB, it takes 10 seconds to scan 100MB, which saves the time of full table scan

    Obviously, the savings are in scanning the full (child) table, if you need to scan all 10 child tables, it is still 10*100MB, which takes 100 seconds

  • Reduces the blocking time associated with locks (mainly table locks, but also to some extent row locks)

    The main purpose of a split table is to speed up select, not insert, UPDATE, or DELETE, but for table operations, all four of which happen all the time. Write operations lock tables or rows. Using a split table can reduce the blocking time of lock code