Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Materialized Views, how often they updated in MS SQL? Expand / Collapse
Author
Message
Posted Thursday, August 28, 2014 9:59 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: 2 days ago @ 11:24 AM
Points: 181, Visits: 440
Hi,
Unlike in Oracle we don't option to set update frequency for MViews in SQL SErver, so just curious how it works in there.
I have MView (aka Indexed view with schemabinding) with 1M rows, and this morning at 9am got .5 million load of new rows in underlying tables.

Will I have 1.5 million if I do select at 9.05 am? Who controls that refresh, or upon first Select it still do sync?

Thanks
Mario
Post #1608331
Posted Thursday, August 28, 2014 11:42 AM This worked for the OP Answer marked as solution


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Yesterday @ 3:43 PM
Points: 43,047, Visits: 36,206
It's updated as part of the transaction which modified the base tables.

You'll have 1.5 million if you query one microsecond after the commit for the insert into the base table.



Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass

Post #1608360
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse