If you can help me, I'm not able to discover why this query below hangs ("fetching rows...") when accessing this ultralite database: http://www.4shared.com/file/Jj_LbFd-/ESP_pcom.html with Interactive SQL.
SELECT distinct top 100 price.code, price.product, "table", fobPrice, cifPrice, descount, cost, MaximumDiscount, MinimumQuantity, QuantityMultiplier, UnitOfMeasure.Code as UOMCode, UnitOfMeasure.Name as UOMName, Product.description, Product.displaystock, Product.reference, Product.special, ProductStock.Stock, Packing FROM price inner join UnitOfMeasure on price.UnitOfMeasure = UnitOfMeasure.Code INNER JOIN Product ON price.Product = Product.Code LEFT OUTER JOIN ProductStock ON ProductStock.Product = price.Product AND price.UnitOfMeasure = ProductStock.UnitOfMeasure WHERE description LIKE 'lixa%' AND "table" = 1 AND Product.status = 'A' ORDER BY Product.reference
What is weird is that if I change the like clause to '%lixa' (witch should be worse) instead of 'lixa%', the query runs OK.
This problem started when I upgraded to version 184.108.40.20640. With version 220.127.116.1152 the query run normally.
Thanks in advance
Dropping and recreating the index index_product1 resolves the pegged CPU that was the hang behaviour. The drop causes the query to use the index index_product4. As an aside, the like "%lixa" query plan uses the primary key index to resolve the query.
answered 19 Feb '13, 22:01