Urgent Problem in performance of a query [message #54534] |
Wed, 20 November 2002 19:24 |
subodh
Messages: 1 Registered: November 2002
|
Junior Member |
|
|
There is a table with 50 million records. Data stored in this table is on weekly basis. Users evaluate data thru this query on monthly basis. So I have to use date range instead of exact date in the query. This table has a primary key consisting of five column. The lead column on this primary key is the week-end_date. In my query, I'm including all the primary key columns in exact same order as in primary key, but giving date range of 4 weeks instead of exact match. The query is taking more than 30 sec(which is not acceptable), whereas if I give exact date then I'm getting results within no time. I checked the explain plan, cost it was giving 42,600 for date range and only 4 for exact date. Also Explain plan was telling that it was using different index other than primary key. When I tried to force primary key index, cost shoot upto nearly 80,000. I really don't know now what to d. And I have to use date range. Table is analyzed. What I'm looking for is the explanation why it is happening. If anyone has faced such kind of problem, please do share with me. I'll appreciate it. Thanks in advance
Subodh
|
|
|
|