Ads 10.10.0.49 With Arc32 Why this SQL :
is more slowest to this
I have an index to PhoneNumber Field |
The XBase expression "$" and the SQL expression LIKE are not equivalent. LIKE can only be optimized if the leading character is not a wildcard character.
With this SQL : SELECT FROM "Table" WHERE CONTAINS(PhoneNumber, '444*') AND (PhoneNumber LIKE '%(444)%') ORDER BY PhoneNumber If I exclude the ORDER BY, the result set appear after 0 Sec 502 ms. But, if run the SQL with ORDER BY, the result set appear after 32 Sec 911 ms My table contains 980000 records and I have an FTS index to PhoneNumber field. If I change the FTS index to simple index on PhoneNumber Field, the result set without ORDER BY appear more faster, 7 Min 32 Sec.
(22 Sep '14, 10:48)
Marius Cere
The LIKE operator forces a static cursor. With the ORDER BY the cursor needs to be fully populated and then the ORDER BY can be applied. Without the ORDER BY the server can return the result set after the first few records have been added. You should see the same performance by doing a GO BOTTOM.
(22 Sep '14, 11:24)
Edgar Sherman
I understand. Thanks Edgar.
(22 Sep '14, 11:31)
Marius Cere
|