Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-63204

Explore: Automatic re-prepare when...

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Unresolved
    • Major
    • Morpheus
    • Morpheus
    • query
    • None
    • 0

    Description

      This improvement is to discuss and explore if there is a way for us to automatically re-prepare (i.e. invalidate prepared cache entry plans) either based on plan attributes or configuration.

      If for some reason there is an issue with index availability when a statement is prepared, it can be left using a valid but sub-optimal plan without DBA intervention.  For example, it may be planned to use a sequential scan (correct for the time of planning) and won't change even when a suitable index is later made available, without manually forcing a repeat of the prepare.

      Two ideas thus far are:

      1. Always mark plans with primary scans (regardless of indexer) as invalidated so they're plans are built on every execution.
        1. Down-side is that effectively we do away with prepared statements (the benefits thereof) for any primary-scan containing plan with no means to selectively avoid this.
        2. Would likely need feature control.
      2. Introduce the concept of a TTL for plans after which they're automatically invalidated and rebuilt.
        1. TTL would be a cluster configuration defaulting to "infinite" to maintain compatibility with current code.
          1. Would therefore not need feature control.
        2. Would apply to all statements.

      Attachments

        Activity

          People

            Donald.haggart Donald Haggart
            Donald.haggart Donald Haggart
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              PagerDuty