Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
abacusdotcom
Posting Yak Master
133 Posts |
Posted - 2008-11-21 : 11:54:27
|
| Dear All, Kindly help me look into this scenario..I am working a BI report consumed by both analysis services and reporting service project. I sourced the data from different databases tables, views. I use 'union all' to join each collection to make a whole view for the report. for exampleTable 1key | item | value | date001 Food 100 200810002 Food 2000 200802Table 2key | item | value | date001 Cloth 300 200803002 Cloth 500 200811To do this for my view..create view xxasSelect key,date,item,valuefrom table1union allSelect key,date,item,valuefrom table1For 2 to 3 tables with few records it worked fine. But I need to add like 60 items(different tables), it began to slow. Then I wrote a store procedure to the loading into another table..create procedure yyastruncate table pp;insert into ppvalues(Select key,date,item,valuefrom table1union allSelect key,date,item,valuefrom table1)worked fine at first, but lately now, if found out that the store procedure kept running even for 2 - 3 hours without finishing. It worked like a 'goto without end' script.Please help.ThanksabacusI sign for fame not for shame but all the same, I sign my name. |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-11-21 : 11:57:20
|
| you mean you need take data from 60 tables? are these tables really big? also what does the execution plan of stored procedure sugests? |
 |
|
|
abacusdotcom
Posting Yak Master
133 Posts |
Posted - 2008-11-21 : 12:17:06
|
quote: you mean you need take data from 60 tables?
Yesquote: are these tables really big?
Yesquote: also what does the execution plan of stored procedure sugests?
It says ok. when I run each table individually, under 8 sec, it has queried 1000 plus record. But when I do all slows.ThanksI sign for fame not for shame but all the same, I sign my name. |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-11-21 : 12:23:13
|
| Nope. i was asking what steps were bottleneck? |
 |
|
|
abacusdotcom
Posting Yak Master
133 Posts |
Posted - 2008-11-21 : 12:47:33
|
| They all work fine individually.I think is at the level of sourcing from different tables.Do you think of another method of doing this same job?ThanksI sign for fame not for shame but all the same, I sign my name. |
 |
|
|
Lamprey
Master Smack Fu Yak Hacker
4614 Posts |
Posted - 2008-11-21 : 13:00:41
|
quote: Originally posted by abacusdotcom[brIt says ok. when I run each table individually, under 8 sec, it has queried 1000 plus record. But when I do all slows.
I think yoiu found your answer. If you doing UNION ALL on 60 tables to populate a single table then just run 60 insert statements and be done with it. |
 |
|
|
abacusdotcom
Posting Yak Master
133 Posts |
Posted - 2008-11-21 : 13:52:58
|
| Thanks... will try that...I sign for fame not for shame but all the same, I sign my name. |
 |
|
|
abacusdotcom
Posting Yak Master
133 Posts |
Posted - 2008-11-26 : 06:13:15
|
| Thanks.... Lampery .. this work fineI sign for fame not for shame but all the same, I sign my name. |
 |
|
|
|
|
|
|
|