Home » SQL & PL/SQL » SQL & PL/SQL » Query Help with Large Table
Query Help with Large Table [message #221854] Wed, 28 February 2007 12:50 Go to next message
fmrock
Messages: 45
Registered: December 2006
Member
I have a query that pulls data from 2 tables.

The tables are "Account" and "Charges"

The charges table has around 12million records.

In the charges table there is a Type. Type=C for Charge and Type=P for Payment. There is also a PRCode for the type of Charge.

Basicly what i am trying to do is pull up all the charges for 2006 for a specific PRCode and that charges payment information.

Since the Charge and Payment information is in the same table, the there is a SEQNO for each charge and in the ApplySEQNO filed is how they are linked.

My question to you, is there a better way to do this? Or anythign that can improve.

If i limit the query to 1 location and not all 100 locations the query will return results fairly quickly, but when i dont use the location code i have not got the results back in a timely fashion.




[Updated on: Thu, 01 March 2007 08:32]

Report message to a moderator

Re: Query Help with Large Table [message #221860 is a reply to message #221854] Wed, 28 February 2007 13:11 Go to previous messageGo to next message
fmrock
Messages: 45
Registered: December 2006
Member
Also, what is the best way to find the Charges that do not have a payment?
Re: Query Help with Large Table [message #221937 is a reply to message #221854] Thu, 01 March 2007 03:11 Go to previous message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
Can you post details of the indexes on these tables, and the Explain plan for the query.
Previous Topic: Accumulate sum until reaching and *exact* required value ?
Next Topic: Cast 1 as integer
Goto Forum:
  


Current Time: Fri Dec 09 21:29:28 CST 2016

Total time taken to generate the page: 0.08244 seconds