Uploaded image for project: 'WiredTiger'
  1. WiredTiger
  2. WT-6487

Force pages to split in the case of lots of small updates on a page

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • WT10.0.0, 4.4.0-rc12, 4.7.0
    • Affects Version/s: None
    • Component/s: None
    • None
    • 3
    • Storage - Ra 2020-07-13

      We can possibly make splits more efficient by forcing a page to split when there are more than a certain number of updates on it. This would be useful in cases where there are a huge number of predominantly small updates on a page being made. michael.cahill reported that the following change offers some performance improvement:

      --- a/src/include/reconcile.i
      +++ b/src/include/reconcile.i
      @@ -197,6 +197,21 @@ __rec_page_time_stats(WT_SESSION_IMPL *session, WT_RECONCILE *r)
       static inline bool
       __wt_rec_need_split(WT_RECONCILE *r, size_t len)
       {
      +    /*
      +     * In the case of a row-store leaf page, trigger a split if a threshold number of saved updates
      +     * is reached. This allows pages to split for update/restore and history store eviction when
      +     * there is no visible data causing the disk image to grow.
      +     *
      +     * In the case of small pages or large keys, we might try to split when a page has no updates or
      +     * entries, which isn't possible. To consider update/restore or history store information,
      +     * require either page entries or updates that will be attached to the image. The limit is one
      +     * of either, but it doesn't make sense to create pages or images with few entries or updates,
      +     * even where page sizes are small (especially as updates that will eventually become overflow
      +     * items can throw off our calculations). Bound the combination at something reasonable.
      +     */
      +    if (r->page->type == WT_PAGE_ROW_LEAF && r->entries + r->supd_next > 10)
      +        len += r->supd_memsize / 10;
      +
           /* Check for the disk image crossing a boundary. */
           return (WT_CHECK_CROSSING_BND(r, len));
       }
      

            Assignee:
            alex.cameron@mongodb.com Alex Cameron (Inactive)
            Reporter:
            alex.cameron@mongodb.com Alex Cameron (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: