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 : QODBC Slow / Fails on large InvoiceLine data set - HELP!!!Search Forum

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

 New Topic 
 
 Post Reply 
[1]  
 QODBC Slow / Fails on large InvoiceLine data set - HELP!!! 
 Author   Message 
  BillA 
  
 Group: Members 
 Posts: 9 
 Joined: 2006-06-03 
 Profile
 Posted : 2006-06-03 01:56:55
I NEED HELP!!!

I have tried several ways over the last week (unsuccessfully) to get a complete data dump of the InvoiceLine data from QB Ent. 6 Mfg. Ed.  There are over 100K records in that data set.  I had the client upgrade to QB Ent. 2006 from QB 2005 Pro just for this reason.  I have tried the following methods for getting this data set:
  • SQL Server DTS copy to a SQL Server Table
  • MS Access Linked Table with a customized query
  • Crystal Reports using a Command
  • Crystal Reports using a Table
  • VB Demo
I have tried both optimized and unoptimized queries.  They are all failing at one point or another.  I did get SQL Server DTS to do one complete dump which took over 6 hours!  Since then I have not even been able to get that to work again.

Since then I have Cleaned up the company data, made a portable file then re-opened it to reduce the file size and performed a re-build on the data several times.  I have also re-installed QODBC a few times and also changed the optimizer directories in order to reset the optimizer which reports "Data Load Successful" when in fact it hasn't done anyting.

When running an unoptimized query, the driver status panel will appear and seems to get stuck at  "Open Table" for an extended period of time or sometimes indefinitely.  WHAT AM I DOING WRONG? 

  Top 
  Tom 
  6c3c1_sdk-qodbc.gif
 Group: Administrator 
 Posts: 5510 
 Joined: 2006-02-17 
 Profile
 Posted : 2006-06-03 13:46:27

When QODBC calls QuickBooks, QuickBooks is trying to return a HUGE XML document of 100,000 records here and you are clearly using up all the system resources on your computer.

I suggust you extract all the information year by year you require by running year by year subset queries instead like this:

select * from InvoiceLine UNOPTIMIZED WHERE Txndate >= {d '2003-01-01'} and Txndate < {d '2004-01-01'}

select * from InvoiceLine UNOPTIMIZED WHERE Txndate >= {d '2004-01-01'} and Txndate < {d '2005-01-01'}

select * from InvoiceLine UNOPTIMIZED WHERE Txndate >= {d '2005-01-01'} and Txndate < {d '2006-01-01'}

select * from InvoiceLine UNOPTIMIZED WHERE Txndate >= {d '2006-01-01'} 

 

  Top 
  BillA 
  
 Group: Members 
 Posts: 9 
 Joined: 2006-06-03 
 Profile
 Posted : 2006-06-04 23:22:21
Can you please clarify how the optimizer works?  If I run an optimized query and there is, let's say, one new record of data since the last optimization, will the optimized query ignore the new record?  or will it detect that there are new records outside of the optimized set and run unoptimized?
 

  Top 
  Tom 
  6c3c1_sdk-qodbc.gif
 Group: Administrator 
 Posts: 5510 
 Joined: 2006-02-17 
 Profile
 Posted : 2006-06-05 08:13:44

See: How do I setup the QODBC Optimizer? Where are the Optimizer options? for all the details. By default the optimizer will update new and changed entries in a table from QuickBooks first and then execute the query against the local optimized table. This is faster than reading everything out of QuickBooks every time, especially the more data you have.

If you extract all the information year by year you require by running year by year subset queries instead like this:

select * from InvoiceLine WHERE Txndate >= {d '2003-01-01'} and Txndate < {d '2004-01-01'}

select * from InvoiceLine WHERE Txndate >= {d '2004-01-01'} and Txndate < {d '2005-01-01'}

select * from InvoiceLine WHERE Txndate >= {d '2005-01-01'} and Txndate < {d '2006-01-01'}

select * from InvoiceLine WHERE Txndate >= {d '2006-01-01'} 

you will also update your optimized table. 

 

  Top 
  BillA 
  
 Group: Members 
 Posts: 9 
 Joined: 2006-06-03 
 Profile
 Posted : 2006-06-07 23:20:29
Thank you for the information.  That did help, at one point.  Now I am having the following problem.  The same query that took under an hour yesterday while testing failed to complete in over 8 hours overnight last night.  This is the exact same query that was used with he same, unchanged ODBC DSN.  I would like to post or send to you the screenshot which shows the QODBC status panels, log file and memory / CPU usage statistics  but there is no facility for that in this forum. 

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

Pictures can be inserted/uploaded by using the Insert/Edit Image button while editing your forum post:

But logs and pictures won't help here. Please turn off the QODBC status panel, and make sure that Detail Tracing is off in the QODBC Setup screen and close the date range of the queries to even month ranges!

select * from InvoiceLine UNOPTIMIZED WHERE Txndate >= {d '2006-06-01'} and Txndate < {d '2006-07-01'}

 

  Top 
  BillA 
  
 Group: Members 
 Posts: 9 
 Joined: 2006-06-03 
 Profile
 Posted : 2006-06-08 11:11:18

I would like to run the optimized set because of the time savings.  Are you suggesting to turn off the optimizer just for testing purposes or for production?  Also,  extracting data for a whole year worked fine until this "hiccup".  It seems that the following statement has been true in the last two weeks of testing:  If  an application accessing QODBC has a problem during execution, QODBC does not handle that well.  Upon re-accessing the same query (after shut-down and re-boot) QODBC hangs as decribed in my earlier post.  I have found that the the only way to "clear" everything is to uninstall QODBC, delete all of the DSNs and Query Optimizer files, then re-install QODBC.  None of the other things I tried would fix the QODBC data access problems once it hung that first time.  Any thoughts on this?

 

  Top 
  Tom 
  6c3c1_sdk-qodbc.gif
 Group: Administrator 
 Posts: 5510 
 Joined: 2006-02-17 
 Profile
 Posted : 2006-06-08 11:54:34
No doubt you are corrupting your .opt file, you don't have to reinstall QODBC, see: How do I switch OFF or RESET the QODBC optimizer?  

  Top 
  BillA 
  
 Group: Members 
 Posts: 9 
 Joined: 2006-06-03 
 Profile
 Posted : 2006-06-08 20:43:22

I had already tried RESETTING the Optimizer per those instructions in previous instances without success.  I went ahead and tried it again last night at your suggestion and here are the results.

 System is a 3.4GHz P4 with 2GB RAM running as the QB File Host: (All DSNs, queries and optimizations referenced in these posts are being run directly on this box).  Physical Memory Usage has never exceeded 1.3GB.

  • Went into the Optimizer options in the ODBC Driver for Quickbooks Setup screen.
  • De-Selected "Use Optimizer"
  • Appplied Changes and Exited
  • Deleted the Optimizer Files in the folder as instructed.
  • Opened the ODBC Driver setup screen again
  • Selected "Use Optimizer"
  • Selected a new, never-used directory for  the Optimizer Database Folder.
  • Ran "qodbcful.exe DSN Name" from the C:\Program Files\Intuit\QuickBooks Enterprise Solutions 6.0\Components\QODBC directory at the command prompt.
  • Started the re-build at 11:00PM last night.  No other users on system.
  • As of 6:30am this morning the process is still running.
  • The .OPT file is 78,214 KB so far
  • The .OPT-journal file is 5KB
  • There is one message in the QODBCLOG.TXT and it reads:
  • 2006-06-08 02:22:02 QODBC Ver:  6.00.00.155 *********************************************************************************************************************
    IsAService: True
    SQLOptimize_OpenOptimizeDBHandle prepare:
    SELECT "type", "tbl_name" FROM "SQLite_MASTER"
    database is locked

When the users come in this morning I will most likely have to abort the re-build because of system performance degradation.

QUESTIONS:

  • How long should a full re-build take? (The QB Data file is approximately 300MB in size)
  • If an Invoice record (for example) is added or changed, will the optimizer kick in to update ONLY THE NEW new/changed records to the optimized data set or  does it need to completely re-optimize all of the records in the tables affected by the addition/change of the record? I know that this question was asked before but I need clarification.  The actual physical activity and time frames that I have experienced do not seem to match with the "update changed records only" description that I received in an earlier post.
  • Your advice in these issues has continued to be  to "run UNOPTIMIZED queries".  Is there a reason for this?
  • Can I expect to have problems when running optimized queries while users are actively using the system?
 

  Top 
  Tom 
  6c3c1_sdk-qodbc.gif
 Group: Administrator 
 Posts: 5510 
 Joined: 2006-02-17 
 Profile
 Posted : 2006-06-08 22:56:51

With large company files, we don't recommend a full load of all the data at once. In fact we recommend optimizing the tables you require on a table by table basis only. For example, for the InvoiceLine table you can fully resync your optimized InvoiceLine table by running:-

sp_optimizefullsync InvoiceLine

By default the QODBC optimizer will update new and changed entries in a table from QuickBooks first and then execute the query against the local optimized table. This is faster than reading everything out of QuickBooks every time, especially the more data you have. Please keep in mind that the QODBC Optimizer .opt file is local to your computer (single user) only and it can't be shared with other users.

I had used the UNOPTIMIZED tags to call QuickBooks directly because the basic rule is to always read historical information out of the .opt file (NOSYNC) and to read very new data directly out of QuickBooks (UNOPTIMIZED).

 

  Top 
  BillA 
  
 Group: Members 
 Posts: 9 
 Joined: 2006-06-03 
 Profile
 Posted : 2006-06-09 01:44:31
Can you please point me to the documentation for the Optimizer command line utilities and their parameters? 

  Top 
  Tom 
  6c3c1_sdk-qodbc.gif
 Group: Administrator 
 Posts: 5510 
 Joined: 2006-02-17 
 Profile
 Posted : 2006-06-09 08:01:00
See: How do I setup the QODBC Optimizer? Where are the Optimizer options?  

  Top 
  BillA 
  
 Group: Members 
 Posts: 9 
 Joined: 2006-06-03 
 Profile
 Posted : 2006-06-09 21:21:06
OK, so I am resigned to the fact that the Invoiceline Table takes up to 5 hours to completely optimize on this system because it is so large.  What I don't understand is why the optimizer insists on Optimizing the "ReceivePaymentLine" table when I try to access the optimized InvoiceLine Database.  There are no references in my query to that table AT ALL.  My query is simply "SELECT * FROM INVOICELINE NOSYNC".  Why would it try to optimize that table when there is no reference to it at all? Does this mean that the OPT file is corrupt?  If so then there must be an issue or bug with large datasets (over 100K records) ?   Again, I am stumped. 

  Top 
  Tom 
  6c3c1_sdk-qodbc.gif
 Group: Administrator 
 Posts: 5510 
 Joined: 2006-02-17 
 Profile
 Posted : 2006-06-09 21:44:44

Sorry, we look at the ReceivePaymentLines internally to check if there's any payments that need to be updated against InvoiceLines stored in the optimized table.

Because you did "SELECT * FROM INVOICELINE NOSYNC", the SELECT * forces a ReceivePaymentLine lookup to make sure open balances are correct and because ReceivePaymentLine hasn't been optimized it started it I guess even with a NOSYNC.

So I suggest you optimize your ReceivePaymentLine table too:

sp_optimizefullsync ReceivePaymentLine

Once your InvoiceLine and ReceivePaymentLine tables have been optimized you just need to execute a query on InvoiceLine to update it or you can update it manually at any point of time by doing:-

sp_optimizeupdatesync ReceivePaymentLine

sp_optimizeupdatesync InvoiceLine

 

  Top 
  BillA 
  
 Group: Members 
 Posts: 9 
 Joined: 2006-06-03 
 Profile
 Posted : 2006-06-10 00:46:27
So, once I have done a full optimization (5+ hours) of invoicelinedata I should be able to incrementally update the optimized file nightly by running "sp_optimizeresync invoiceline" which should take significantly less time?  Also, I am afraid that the file will become corrupt again at some point leaving the client high and dry for a full workday without being able to run their invoice and salesorder reports.  Is there a way to quickly and easily check to see if the OPT file is corrupt before running my nightly RESYNC? 

  Top 
  Tom 
  6c3c1_sdk-qodbc.gif
 Group: Administrator 
 Posts: 5510 
 Joined: 2006-02-17 
 Profile
 Posted : 2006-06-10 11:43:14

I think you're missing the point, once your InvoiceLine, SalesOrderLine and ReceivePaymentLine tables have been optimized, QODBC by default will just update the .opt file when you do a query on the table. So you only have to use sp_optimizeupdatesync if it's part of a batch reporting or updating process or something. You don't need to run it every night to use QODBC.

What you now need to do is NOT run full Select * queries for every column and every row in a table anymore. Imagine if QuickBooks did that?, it would be very slow.

 

 

  Top 
  BillA 
  
 Group: Members 
 Posts: 9 
 Joined: 2006-06-03 
 Profile
 Posted : 2006-06-10 13:39:19
I appreciate your responses but in the end my issues have still gone unresolved.  I guess the issue here is that Quickbooks "Enterprise Edition" is not an Enterprise package at all.  The facts that: QB slows to a crawl with large data sets, you cannot access tables directly (without having QB act as a nanny)  and that it's built-in reporting is limited to the information Intuit thinks you need are just a few of the glaring limitations.  I was sold by Intuit on the new features ,speed and capabilities in Enterprise Edition 2006 and the fact that the "Database" is running on a "real" DB back-end.  I convinced the customer to upgrade on these selling points.  If I had known how anemic it still was I would have convinced them to move to a more complete accounting package.  Now I am stuck holding the bag and I am trying to make the best of a bad situation.  My fault entirely.

A couple of observations:
* 150,000 RECORDS IS NOT A LARGE DATA SET
* Doing nightly data dumps should not require external optimization and the problems associated with keeping what amounts to an external index in sync with the data.
* A customer should not have to compromise it's (sound) business practices to accomodate a software package that is trying to be something that it is not.
 

  Top 
  Tom 
  6c3c1_sdk-qodbc.gif
 Group: Administrator 
 Posts: 5510 
 Joined: 2006-02-17 
 Profile
 Posted : 2006-06-11 01:40:32

We came to this realization some time ago. That's why we put a SQLite engine behind QODBC as it's optimizer in v6. In the meantime, Intuit did change to a Sybase back end for QuickBooks 2006 for USA users only, but they didn't change their data layout to take advantage of using the Sybase backend.

You will find that using our backend like this with NOSYNC will give you fast results:-

SELECT InvoiceLine.TxnID, InvoiceLine.TimeModified, InvoiceLine.TxnNumber, InvoiceLine.CustomerRefListID, InvoiceLine.CustomerRefFullName, InvoiceLine.ClassRefListID, InvoiceLine.ClassRefFullName, InvoiceLine.ARAccountRefListID, InvoiceLine.ARAccountRefFullName, InvoiceLine.TemplateRefListID, InvoiceLine.TemplateRefFullName, InvoiceLine.TxnDate, InvoiceLine.RefNumber, InvoiceLine.BillAddressAddr1, InvoiceLine.BillAddressAddr2, InvoiceLine.BillAddressAddr3, InvoiceLine.BillAddressAddr4, InvoiceLine.BillAddressCity, InvoiceLine.BillAddressState, InvoiceLine.BillAddressPostalCode, InvoiceLine.BillAddressCountry, InvoiceLine.ShipAddressAddr1, InvoiceLine.ShipAddressAddr2, InvoiceLine.ShipAddressAddr3, InvoiceLine.ShipAddressAddr4, InvoiceLine.ShipAddressCity, InvoiceLine.ShipAddressState, InvoiceLine.ShipAddressPostalCode, InvoiceLine.ShipAddressCountry, InvoiceLine.IsPending, InvoiceLine.IsFinanceCharge, InvoiceLine.PONumber, InvoiceLine.TermsRefListID, InvoiceLine.TermsRefFullName, InvoiceLine.DueDate, InvoiceLine.SalesRepRefListID, InvoiceLine.SalesRepRefFullName, InvoiceLine.FOB, InvoiceLine.ShipDate, InvoiceLine.ShipMethodRefListID, InvoiceLine.ShipMethodRefFullName, InvoiceLine.Subtotal, InvoiceLine.ItemSalesTaxRefListID, InvoiceLine.ItemSalesTaxRefFullName, InvoiceLine.SalesTaxPercentage, InvoiceLine.SalesTaxTotal, InvoiceLine.AppliedAmount, InvoiceLine.Memo, InvoiceLine.IsPaid, InvoiceLine.CustomerMsgRefListID, InvoiceLine.CustomerMsgRefFullName, InvoiceLine.IsToBePrinted, InvoiceLine.CustomerSalesTaxCodeRefListID, InvoiceLine.CustomerSalesTaxCodeRefFullName, InvoiceLine.SuggestedDiscountAmount, InvoiceLine.SuggestedDiscountDate, InvoiceLine.InvoiceLineType, InvoiceLine.InvoiceLineSeqNo, InvoiceLine.InvoiceLineGroupTxnLineID, InvoiceLine.InvoiceLineGroupItemGroupRefListID, InvoiceLine.InvoiceLineGroupItemGroupRefFullName, InvoiceLine.InvoiceLineGroupDesc, InvoiceLine.InvoiceLineGroupQuantity, InvoiceLine.InvoiceLineGroupIsPrintItemsInGroup, InvoiceLine.InvoiceLineGroupTotalAmount, InvoiceLine.InvoiceLineGroupSeqNo, InvoiceLine.InvoiceLineTxnLineID, InvoiceLine.InvoiceLineItemRefListID, InvoiceLine.InvoiceLineItemRefFullName, InvoiceLine.InvoiceLineDesc, InvoiceLine.InvoiceLineQuantity, InvoiceLine.InvoiceLineRate, InvoiceLine.InvoiceLineRatePercent, InvoiceLine.InvoiceLinePriceLevelRefListID, InvoiceLine.InvoiceLinePriceLevelRefFullName, InvoiceLine.InvoiceLineClassRefListID, InvoiceLine.InvoiceLineClassRefFullName, InvoiceLine.InvoiceLineAmount, InvoiceLine.InvoiceLineServiceDate, InvoiceLine.InvoiceLineSalesTaxCodeRefListID, InvoiceLine.InvoiceLineSalesTaxCodeRefFullName, InvoiceLine.InvoiceLineOverrideItemAccountRefListID, InvoiceLine.InvoiceLineOverrideItemAccountRefFullName from InvoiceLine NOSYNC WHERE Txndate >= {d '2005-01-01'} and Txndate < {d '2006-01-01'}

 

  Top 
  osullivan 
  
 Group: Members 
 Posts: 4 
 Joined: 2006-11-01 
 Profile
 Posted : 2006-11-03 04:58:43

Well I was very relieved to read your post and at least know that there was someone else experiencing the same issues with QODBC driver that I am seeing as I attempt to pull only 1,081 records from the Invoice table.

 

I tried DTS from SQL Server 2003, I tried to do this under the SQL Server 2005 flavor of DTS, and I tried using the Import wizard to my local database and to the production servers. I set and un-set every possible check box and radio button for the QODBC data source possible. I know the issue isn't the ODBC connection as I can see my data using the VB Demo App that came with the Driver Install. Even that takes eight minutes to return a result set from

 

select * from Invoice where BalanceRemaining <> 0

 

There were 1081 rows in this result set.

 

I have set this query going through DTS overnight both on SQL Server 2003 and SQL Server 2005 and it's still not done when I return the following morning.

ODBC drivers shouldn't be this complicated or slow. I've used DTS before to get to legacy data in the realm of 12 million Invoice records and I have never seen anything as inefficient as this. I am just gald that I decided to evaluate it properly before making the mistake of buying it.

 

 

  Top 
  Tom 
  6c3c1_sdk-qodbc.gif
 Group: Administrator 
 Posts: 5510 
 Joined: 2006-02-17 
 Profile
 Posted : 2006-11-03 08:59:48
Because of the large record sets being used here, the Iterator or Chunk Size in the Advanced Tab in the QODBC Setup Screen should be setup up to accomodate the largest returned record set. The default is 500, and it can be set to any value up to 100,000.  

  Top 
  Tom 
  6c3c1_sdk-qodbc.gif
 Group: Administrator 
 Posts: 5510 
 Joined: 2006-02-17 
 Profile
 Posted : 2007-04-10 08:19:49
We now recommend optimizing your company file first and then using DTS calling the tables as queries using the NOSYNC tag. See: Using DTS to Load QuickBooks Data into Microsoft SQL Server for further details. 

  Top 
 New Topic 
 
 Post Reply 
[1]  

Jump to