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
|
|
Query Speed |
Author |
Message |
robc |
|
Group | : Members |
Posts | : 13 |
Joined | : 2006-04-27 |
|
Profile |
|
Posted : 2006-06-22 08:47:42 |
It takes over a minute for this query to return 1060 rows. Is there anything you can recommend that I can do to speed this up? By the way, just selecting from the invoice table is not enough. I need a complete list of customers and not all customers have been invoiced.
Select cust.name, inv.BalanceRemaining, inv.DueDate, inv.TxnDate, inv.IsPaid, cust.listId from customer cust left outer join invoice inv on inv.customerRefListId = cust.ListId where cust.IsActive = 1
Thanks, Rob |
|
|
|
Tom |
|
Group | : Administrator |
Posts | : 5510 |
Joined | : 2006-02-17 |
|
Profile |
|
Posted : 2006-06-22 10:58:17 |
Sorry, your left outer join has to do a full table scan of the customer table and look up all the the invoices for each customer for every customer you have.
This is the fastest, but only shows Customers with outstanding balances:
sp_report CustomerBalanceSummary show Text, Label, Amount parameters DateMacro = 'All' |
|
|
|
|