WL#407: Boyer-Moore optimization of LIKE for POS and INSTR functions
Affects: Server-7.1 — Status: Un-Assigned
Boyer-Moore (sp?) optimisation of LIKE that should be enabled also by the POS and INSTR functions. Monty has done a good optimisation of LIKE. If you have a long TEXT field called MYFIELD and need to look for the records with occurrences of the text string "my value", Monty implements the screening test WHERE MYFIELD LIKE "%my value%" as follows: 1. He lists the eight characters " aelmuvy" as the only ones existing in the string he looks for 2. He looks only at positions 8, 16, 24 (multiples of the search string length) to see whether that letter is one of " aelmuvy". 3. If not, he just skips forward at eightfold speed. 4. Otherwise, he looks whether the other parts of the string would match. Now, Monty told me we could add a feature to LIKE to tell the end user at which position the text was found. "But we have POS and INPUT for that", I said. Then he remembers he didn't implement Boyer-Moore optimisation for POS and INSTR, which is the task. Kaj
Copyright (c) 2000, 2021, Oracle Corporation and/or its affiliates. All rights reserved.