dbTalk Databases Forums  

using single table costing more than using JOINS

comp.databases.oracle.tools comp.databases.oracle.tools


Discuss using single table costing more than using JOINS in the comp.databases.oracle.tools forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Aravindh
 
Posts: n/a

Default using single table costing more than using JOINS - 08-07-2007 , 11:49 AM






Hi,

I have a large table called as JP_HISTORY_TBL. This has about 10
million rows.
I did a select * from jp_history_tbl where assigned_to_pg_new =
'IS00000025'

It did a full table scan and the cost is 10085

Now I joined the JP_HISTORY_TBL with another table called as
ps_rf_provider_grp TABLE. This table when joined brings down the cost
and the time of execution drastically

select * from jp_history_tbl a,ps_rf_provider_grp b where
a.assigned_to_pg_new = 'IS00000025' and a.assigned_to_pg_new =
b.provider_grp_id

It brings down the Cost drastically to just 83..

Then I am totally CONFUSED of why we should create a flattened table
to store all the data. We are in the process of creating a flattened
table which will contain the description (which is there in the
PS_RF_PROVIDER_GRP table).. Now looking at the above cost we feel that
our approach itself it totally illogical and IRRELEVANT.
I want to know how ppl are designing big big warehousses with immense
amount of flattened data...


Reply With Quote
  #2  
Old   
sybrandb@hccnet.nl
 
Posts: n/a

Default Re: using single table costing more than using JOINS - 08-07-2007 , 03:59 PM






On Tue, 07 Aug 2007 09:49:21 -0700, Aravindh <knaravindh81 (AT) gmail (DOT) com>
wrote:

Quote:
Hi,

I have a large table called as JP_HISTORY_TBL. This has about 10
million rows.
I did a select * from jp_history_tbl where assigned_to_pg_new =
'IS00000025'

It did a full table scan and the cost is 10085

Now I joined the JP_HISTORY_TBL with another table called as
ps_rf_provider_grp TABLE. This table when joined brings down the cost
and the time of execution drastically

select * from jp_history_tbl a,ps_rf_provider_grp b where
a.assigned_to_pg_new = 'IS00000025' and a.assigned_to_pg_new =
b.provider_grp_id

It brings down the Cost drastically to just 83..

Then I am totally CONFUSED of why we should create a flattened table
to store all the data. We are in the process of creating a flattened
table which will contain the description (which is there in the
PS_RF_PROVIDER_GRP table).. Now looking at the above cost we feel that
our approach itself it totally illogical and IRRELEVANT.
I want to know how ppl are designing big big warehousses with immense
amount of flattened data...
Just curious: why do you think reposting will get you better answers?
This is the second time you post this in the wrong group and the
second time without version and WITHOUT EXPLAIN PLAN results!!

Why do you insist on calling out for crystal balls?

Next time: please either post with sufficient details, or (in the
event that is asked to much, as you don't have a problem with people
wasting their free time with helping you out for free) better still:
don't post at all, and go to Oracle Technical Support.
At least those monkeys are getting paid to address your query, and
having you submit evidence for months.

--
Sybrand Bakker
Senior Oracle DBA


Reply With Quote
  #3  
Old   
Aravindh
 
Posts: n/a

Default Re: using single table costing more than using JOINS - 08-08-2007 , 01:53 AM



On Aug 8, 1:59 am, sybra... (AT) hccnet (DOT) nl wrote:
Quote:
On Tue, 07 Aug 2007 09:49:21 -0700, Aravindh <knaravind... (AT) gmail (DOT) com
wrote:





Hi,

I have a large table called as JP_HISTORY_TBL. This has about 10
million rows.
I did a select * from jp_history_tbl where assigned_to_pg_new =
'IS00000025'

It did a full table scan and the cost is 10085

Now I joined the JP_HISTORY_TBL with another table called as
ps_rf_provider_grp TABLE. This table when joined brings down the cost
and the time of execution drastically

select * from jp_history_tbl a,ps_rf_provider_grp b where
a.assigned_to_pg_new = 'IS00000025' and a.assigned_to_pg_new =
b.provider_grp_id

It brings down the Cost drastically to just 83..

Then I am totally CONFUSED of why we should create a flattened table
to store all the data. We are in the process of creating a flattened
table which will contain the description (which is there in the
PS_RF_PROVIDER_GRP table).. Now looking at the above cost we feel that
our approach itself it totally illogical and IRRELEVANT.
I want to know how ppl are designing big big warehousses with immense
amount of flattened data...

Just curious: why do you think reposting will get you better answers?
This is the second time you post this in the wrong group and the
second time without version and WITHOUT EXPLAIN PLAN results!!

Why do you insist on calling out for crystal balls?

Next time: please either post with sufficient details, or (in the
event that is asked to much, as you don't have a problem with people
wasting their free time with helping you out for free) better still:
don't post at all, and go to Oracle Technical Support.
At least those monkeys are getting paid to address your query, and
having you submit evidence for months.

--
Sybrand Bakker
Senior Oracle DBA- Hide quoted text -

- Show quoted text -
Hi Sybrand,

I am very sorry for not furnishing the correct details..Totally sorry
about that.. I will send out a separate mail to you since I am not
able to attach a word document in this forum. Totally sorry again.

Best Regards
KN Aravindh



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.