Questions tagged [indexed-view]

142 questions
1
vote
0 answers

How to update Indexed View in SQL Server?

I am executing more than 40 reports on a daily basis using SSRS. These reports are using similar data-set with some changes on condition. I think it is better to use an indexed view rather than tables; this will enhance the performance and reduce…
Nawaf
  • 540
  • 1
  • 5
  • 14
1
vote
1 answer

SQL Server Indexed views used instead of tables

I am a little bit confused about using indexed views in SQL Server 2016. Here is my issue. If I have a fact table with a lot of columns and I create an indexed view named IV_Sales as select year, customer, sum(sales) from F_Sales…
presto
  • 26
  • 3
1
vote
1 answer

simulate union to make indexed view

I've got the following table schema in SQL Server 2005 and I'd like to denormalize it into an indexed view for some queries I'm writing until I can make the structural changes permanent. The tables are as follows Writing ( DocumentSerial…
Caveatrob
  • 12,667
  • 32
  • 107
  • 187
1
vote
1 answer

Creating indexed views

When I try to create indexed view I am getting an error "datepart returns indeterministic value, use system defined deterministic function or make the user defined function to return deterministic value" I get this error when i try to create index…
Deepak
  • 6,684
  • 18
  • 69
  • 121
1
vote
4 answers

Fastest SQL query for non-indexed data

I'm building a few custom reports against a SQL Server 2005 database. The database belongs to a 3rd party management application we run. The data I'm pulling isn't among the primary purposes of the site, so the data is largely non-indexed except…
Nathan Loding
  • 3,185
  • 2
  • 37
  • 43
1
vote
1 answer

SQL Server Indexed view for Full Text Search

I want to use the Full Text Search feature of Microsoft SQL Server. If I have a table Client which refers other tables like City, Country, Department, etc. is it better to create a separate table that would hold de-normalized data, which would then…
pevgeniev
  • 389
  • 2
  • 13
1
vote
2 answers

Indexed views. Query ignoring view and uses table instead

My task is to optimize this query: Declare @sumBalance NUMERIC = (select SUM(CURRENT_BALANCE) as Balance from dbo.ACCOUNT_DETAILS) select @sumBalance I've read that the best solution for aggregation functions is using indexed views instead of…
S. Elmar
  • 23
  • 5
1
vote
2 answers

Why does indexed view materialize?

If we create an index to a view, we materialize the view. Why is the view materialized when it is indexed ? What is the signification as opposed to a non-materialized view ? To my understanding, a normal view don't exist physically. Only its…
Kenny
  • 1,902
  • 6
  • 32
  • 61
1
vote
0 answers

Creating indexed view with using AVG in SQL

I am trying to create an indexed view with using aggregate AVG, but can't make it work. Has anybody tried doing it? I found this article but couldn't figure out how to make it work. Here is my script: CREATE VIEW MyView WITH SCHEMABINDING AS …
Dilshod
  • 3,189
  • 3
  • 36
  • 67
1
vote
2 answers

Indexed View with its own rowversion for Azure Search indexer

I'm trying to design the best way to index my data into Azure Search. Let's say my Azure SQL Database contains two tables: products orders In my Azure Search index I want to have not only products (name, category, description etc.), but also…
1
vote
2 answers

TSQL Cannot create index on view - the view uses an implicit conversion from string to datetime

SQL SERVER 2008 r2 I'm trying to Create an Indexed view however I'm getting the following error Cannot create index on view '' because the view uses an implicit conversion from string to datetime or smalldatetime. Use an explicit CONVERT with a…
Mazhar
  • 3,797
  • 1
  • 12
  • 29
1
vote
1 answer

Does MySQL have an equivalent of SQL Server "indexed views"?

Does MySQL have an equalavent to SQL Servers "indexed view" functionality? Is a view faster than a simple query? What I'm specifically looking for is a way for MySQL to create a "view" that will return results faster than simply performing the…
GregJohn
  • 251
  • 1
  • 3
  • 5
1
vote
1 answer

How to Create an indexed view in SQL Server

I'm trying to build an indexed view but returning a duplicate key error, any advice on what to do? I can't use the original table's primary key as the view is being grouped. Many thanks, Jonathan USE [IHG_MST] GO SET NUMERIC_ROUNDABORT OFF SET…
user3840039
  • 47
  • 1
  • 11
1
vote
1 answer

SQL Server indexed calculated column that sums another table

I'd like to effectively add a calculated column, which sums a column from selected rows in another table. I need to to quickly retrieve and search for values in the calculated column without re-computing the sum. The calculated column I'd like to…
1
vote
1 answer

NHibernate and indexed views (materialized views)

Recently I was busy implementing paging functionality with NHibernate and things went smoothly with simple entities, but I hit a performance problem with those ones where multiple joins are required to acquire the requested page. Besides that,…
doblak
  • 3,036
  • 1
  • 27
  • 22