on 2013 Feb 19 10:01 AM
Hi all,
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 12.0.1.3840. With version 12.0.1.3352 the query run normally.
Thanks in advance
Aderval Mendonça
Request clarification before answering.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
9 | |
9 | |
8 | |
6 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.