• unknown's avatar
    Bug#27287 extractvalue() (and updatexml()) extremely slow for large XML · 4c21617d
    unknown authored
    Performance improvements made.
    ExtractValue for large XML values is now much faster
    (about 2000 times faster of 1Mb-long XML values).
    
    
    sql/item_xmlfunc.cc:
      Performance improvement for huge XML values:
      1. Avoid reallocs - reserve extra memory:
      using String::reserve() + String::q_append()
      instead of String::append()
      2. Parent is now not searched through the all previous
      nodes in backward direction. Instead, we do the following:
      - we introduce data->parent - a new member in MY_XML_USER_DATA
      - when entering a new tag/attribute node, we remember offset
        of the current node in data->parent
      - when leaving a tag/attribute node, we change data->parent
        to offset of the parent of the current node.
    4c21617d
item_xmlfunc.cc 71.7 KB