Uploaded image for project: 'Cassandra'
  1. Cassandra
  2. CASSANDRA-7923

When preparing a statement, do not parse the provided string if we already have the parsed statement cached

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Low
    • Resolution: Fixed
    • 2.1.1
    • None

    Description

      If there are many clients preparing the same statement (or the same client preparing it multiple times), there's no point parsing the statement each times. We already have it prepared, we should ship back the prior result.

      I would like us separately to consider introducing some checks to ensure that we never have a hash collision (and error if we do, asking the user to salt their query string), but this change in no way increases the risk profile here, since all we did was overwrite the prior statement with the new one. This change means that clients referencing the old statement continue to function and the client registering the colliding statement will not execute the correct statement, but this is in no way worse than the reverse situation.

      Attachments

        1. 7923.txt
          5 kB
          Benedict Elliott Smith
        2. 7923-test.txt
          2 kB
          T Jake Luciani
        3. 7923-v2.txt
          11 kB
          Tom Hobbs

        Activity

          People

            thobbs Tom Hobbs
            benedict Benedict Elliott Smith
            Tom Hobbs
            Aleksey Yeschenko
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: