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
|
|
Suddenly - slow response |
Author |
Message |
|
Posted : 2008-03-05 00:11:43 |
I'm using and MS-Query from excel to build an income/expense spreadsheet from QB using QODBC. This worked fine last month but now is painfully slow/unusable. Here is the query:
SELECT BillPaymentCheck.TxnDate, BillExpenseLine.ExpenseLineAccountRefFullName, BillExpenseLine.Memo, BillPaymentCheckLine.RefNumber, -BillPaymentCheck.Amount, BillExpenseLine.ExpenseLineClassRefFullName FROM BillExpenseLine BillExpenseLine, BillPaymentCheck BillPaymentCheck, BillPaymentCheckLine BillPaymentCheckLine WHERE BillPaymentCheckLine.AppliedToTxnTxnID = BillExpenseLine.TxnID AND BillPaymentCheck.TxnNumber = BillPaymentCheckLine.TxnNumber AND ((BillPaymentCheckLine.BankAccountRefFullName Like 'citizens%'))
I updated my operating system with MS update since I used this last but don't know of any other changes. Any idea what happened or how to fix? Many thanks! |
|
|
|
Tom |
|
Group | : Administrator |
Posts | : 5510 |
Joined | : 2006-02-17 |
|
Profile |
|
Posted : 2008-03-05 07:55:15 |
The first problem is in: AND ((BillPaymentCheckLine.BankAccountRefFullName Like 'citizens%')), this will cause a full table scan on each pass to find the BillPaymentCheckLine rows. This should hardcoded something like this: AND ((BillPaymentCheckLine.BankAccountRefFullName = 'citizens bank acount')) or if you need to use muliple accounts:
AND ( BillPaymentCheckLine.BankAccountRefFullName = 'citizens one account' or BillPaymentCheckLine.BankAccountRefFullName = 'citizens two account' )
The second problem is that your filter is on BillPaymentCheckLine, so it really should by the (first) primary table called in the query, like this instead:
FROM BillPaymentCheckLine BillPaymentCheckLine, BillPaymentCheck BillPaymentCheck, BillExpenseLine BillExpenseLine
and then the last join should reversed from: AND BillPaymentCheck.TxnNumber = BillPaymentCheckLine.TxnNumber to AND BillPaymentCheckLine.TxnNumber = BillPaymentCheck.TxnNumber
|
|
|
|
|
Posted : 2008-03-05 07:56:13 |
I think I got this myself after reading other posts. I modified the optimizer settings and the query is working well for me again. Thanks! |
|
|
|
|