Click here to monitor SSC
SQLServerCentral is supported by Redgate
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
Posted Thursday, August 28, 2014 9:59 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Yesterday @ 2:24 PM
Points: 254, Visits: 678
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?

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



Group: General Forum Members
Last Login: Saturday, December 3, 2016 5:18 AM
Points: 45,619, Visits: 44,147
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, MVP, M.Sc (Comp Sci)
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