Questions tagged [indexed-view]

142 questions
0
votes
2 answers

Query/Database Optimization: How to optimize this? (and should I use a materialized view?)

I have a question on how to optimize a query. Actually, as I'm going to be running the query frequently, I was thinking of using a materialized or indexed view (is this a good idea here?) or denormalizing. Consider the following four tables (with…
0
votes
1 answer

Move indexed views to a separate filegroup

I have multiple indexed views that I want to move from the primary filegroup into another filegroup, with minimal impact on performance. How can I accomplish this?
mehdi lotfi
  • 11,194
  • 18
  • 82
  • 128
0
votes
1 answer

Indexed view to optimize search over multiple tables

I have a question concerning an idea I have about optimizing performance of a complex search query. This is the situation: Base table, with the fields to search on: Server (uniqueNumber, serverName, hostName) Tables to join, with the fields to…
ibram
  • 140
  • 1
  • 11
0
votes
1 answer

SQL GROUP BY: Getting the most recently updated record for an indexed view

I'm trying to do row versioning using an indexed view, grouping records by their key and timestamp, and taking the max(timestamp) record. This is fine, but the query I have used (see the view below) does a self join, meaning it can't be used in an…
mcintyre321
  • 12,996
  • 8
  • 66
  • 103
0
votes
1 answer

Need some help making an Indexed view with 2 COUNT_BIG's

Ok, I'm trying to make an indexed view that is against a simple table that stores the results of what people think is good/bad for a post. This is the results of a thumbs up / thumbs down, voting on posts. So here's my pseduo fake table…
Pure.Krome
  • 84,693
  • 113
  • 396
  • 647
-1
votes
2 answers

Is there a way to find out which records have changed in an indexed view?

I have a table (invoice details) which has two columns (productid and quantity). I created an indexed view on this table in order to know the balance of products. When a user enters an invoice on a computer, I want to refresh the product balance on…
Attaf
  • 1
  • 1
-1
votes
2 answers

Does SQL Server Management Studio (or SQL Server) evaluate *all* expressions?

Here's my configuration: I have a re-runnable batch script that I use to update my database. Inside of that batch script, I have code that says the following: If Table 'A' doesn't exist, then create Table 'A' and insert rows into it. Later on in…
Jim G.
  • 15,141
  • 22
  • 103
  • 166
1 2 3
9
10