Member Login

Username
Password
Forget Password
New Sign Up
Search Forum

Buy Support
Incidents

If you can't find your answer in the FREE PUBLIC QDeveloper Forum, require URGENT Priority Support, or you need to send us private or confidential information:

Click Here
If you can't login and post questions or you are having trouble viewing forum posts:
Click Here
Callback
Support

If you live in USA, UK, Canada, Australia or New Zealand, you can leave us details on your question and request us to call you back and discuss them with you personally  (charges apply).

Click Here
 
Buy Support
Incidents
If you can't find your answer in the FREE PUBLIC QDeveloper Forum, require URGENT Priority Support, or you need to send us private or confidential information:
Click Here

Forum : Slow Query Processing using QODBCSearch Forum

Forum Home > QODBC - ODBC Driver for QuickBooks > QODBC v8 Forum

 New Topic 
 
 Post Reply 
[1]  
 Slow Query Processing using QODBC 
 Author   Message 
  Clifford 
  
 Group: Members 
 Posts: 24 
 Joined: 2006-04-04 
 Profile
 Posted : 2008-08-26 23:45:17

Hi All, 

 I have Access application which uses pass through query as shown below.

SELECT  SalesOrderLine.SalesOrderLineItemRefFullName AS Item, SalesOrderLine.CustomFieldSalesOrderLineDATEDUE AS DueDate, SalesOrderLine.SalesOrderLineQuantity-SalesOrderLine.SalesOrderLineInvoiced AS QuantityDue, SalesOrderLine.RefNumber AS OrderNumber, SalesOrderLine.CustomerRefFullName AS Customer, SalesOrderLine.PONumber, ItemInventory.QuantityOnHand AS IOnHand FROM {IJ SalesOrderLine UNOPTIMIZED INNER JOIN ItemInventory UNOPTIMIZED On SalesOrderLine.SalesOrderLineItemRefFullName=ItemInventory.FullName}  WHERE (SalesOrderLine.CustomFieldSalesOrderLineDATEDUE <= {fn CONVERT( ({fn TIMESTAMPADD(SQL_TSI_DAY,14,{fn CURDATE()} )}),SQL_VARCHAR)}) OR (SalesOrderLine.CustomFieldSalesOrderLineDATEDUE is Null)

When we run above query it took around 6 minutes to run the equerry; “SalesOrderLine” table has just 750 records. If we run this query in optimized mode query shows “CustomFieldSalesOrderLineDATEDUE” as blank as this is custom field. Also optimized mode query took around same time as in unoptimized mode. We set “Use Optimizer” on and “start of every new connection (with Load Updated Data first)” was selected.  

We would really appreciate any suggestions to improve the speed of the query.

Sincerely, 
Clifford

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

  Top 
  Tom 
  6c3c1_sdk-qodbc.gif
 Group: Administrator 
 Posts: 5510 
 Joined: 2006-02-17 
 Profile
 Posted : 2008-08-27 08:30:25

The use of {fn CONVERT( ({fn TIMESTAMPADD(SQL_TSI_DAY,14,{fn CURDATE()} )}),SQL_VARCHAR)}) causes the where statement to be evaluated and a full table scan to run slowing the query. This is due to a cast error bug within QODBC, the value needs to be absolute.

See: Updating data in Crystal Reports - optimization settings?  for more background on this.

 

  Top 
 New Topic 
 
 Post Reply 
[1]  

Jump to