June 16, 2010 at 6:42 am
I have database with 6 yrs of data and now i am splitting that into 2 different database's having 3yrs of data in each because we use only latest 3 yrs of data and the old database will be marked as read only.
For the above process i want to make all my views presented to the users in the same way as before but i have to modify them so as to point older and new databases both. what is the best approach ?
do i have to change like this..
Current View
ALTER VIEW [dbo].[Employee]
AS
Select * from EmployeeR
union all
Select * from EmployeeB
Expected View:
ALTER VIEW [dbo].[Employee]
AS
Select * from EmployeeR
union all
Select * from EmployeeB
UNION ALL
Select * from OldDB.dbo.EmployeeR
union all
Select * from OldDB.dbo.EmployeeB
Is there any other method to get better peroformance ? Do you think i get gud performance by listing all columns instead of "select*" ?
June 16, 2010 at 7:05 am
Have you heard about table partitioning?
June 16, 2010 at 7:05 am
Tara-1044200 (6/16/2010)
I have database with 6 yrs of data and now i am splitting that into 2 different database's having 3yrs of data in each because we use only latest 3 yrs of data and the old database will be marked as read only.
Looks like a good place to apply partitioning.
Expected View:
ALTER VIEW [dbo].[Employee]
AS
Select * from EmployeeR
union all
Select * from EmployeeB
UNION ALL
Select * from OldDB.dbo.EmployeeR
union all
Select * from OldDB.dbo.EmployeeB
This is how partitioned views used to work. You could also do it this way. Why are you moving this data in a different database? Wouldn't it be easier to keep everything in the same DB and use differente filegroups for older data?
Do you think i get gud performance by listing all columns instead of "select*" ?
Absolutely not.
-- Gianluca Sartori
June 16, 2010 at 7:05 am
All the databases are partitioned but still we want to split them for which we have reasons to do. The reason is that we backup and restore database from stage to production and it would be easier for us to play with small data.
June 16, 2010 at 7:10 pm
any other thoughts on improving performance on my views ?
Viewing 5 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply