SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Performance related issue
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Kimi86
Yak Posting Veteran

54 Posts

Posted - 07/16/2012 :  10:09:45  Show Profile  Reply with Quote
I am creating a massive view with around 250 columns. Let me call it consolidated_View
This view is created by joining 11 views on a single key which is an int.
I need to be sending data in this view to few business users on daily basis

A select * from the consolidated_View takes around 6 hrs to populate data which is tooo much. To reduce the time I created a job that physicalizes the 11 views into tables. Now the consolidated_View takes 4 hours which is also a lot. I would love to physicalize the consolidated_View but that would take too much space which I don’t have.

Any suggestions what I can do to just be able to get the data on daily basis without taking so long

visakh16
Very Important crosS Applying yaK Herder

India
47173 Posts

Posted - 07/16/2012 :  10:13:38  Show Profile  Reply with Quote
how many rows does your select from 11 tables retrieve? did you have a look at execution plan for query?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

Kimi86
Yak Posting Veteran

54 Posts

Posted - 07/16/2012 :  10:18:14  Show Profile  Reply with Quote
The view is massive. It generates around 4546764 rows daily. I tried to look at the execution plan but could not find much clue. I am not very efficient in reading execution plans. But As i said i am doing a joining on a single key which is an integer
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
47173 Posts

Posted - 07/16/2012 :  10:27:55  Show Profile  Reply with Quote
do you've indexes present on joining columns? also do you really need all these records. can you apply filters to bring down record count?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

Kimi86
Yak Posting Veteran

54 Posts

Posted - 07/16/2012 :  10:54:59  Show Profile  Reply with Quote
not really. Actually I have physicallized ony 6 of the 11 views instead of phisicallizing them all. These were the ones which took longest while running individually. If i have to create index on all the joining tables and views i will have to create indexed views.. is that right??
Go to Top of Page

Kimi86
Yak Posting Veteran

54 Posts

Posted - 07/16/2012 :  10:57:57  Show Profile  Reply with Quote
also if i have to create indexed views its better that i phisicalize all the remaining views as well since indexed views also take up space.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
47173 Posts

Posted - 07/16/2012 :  11:32:20  Show Profile  Reply with Quote
quote:
Originally posted by Kimi86

also if i have to create indexed views its better that i phisicalize all the remaining views as well since indexed views also take up space.


i was asking on physicalised tables

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.11 seconds. Powered By: Snitz Forums 2000