materialized-views

NHibernate and indexed views (materialized views)

Hi! 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, implementation would be much simpler if the queries could be performed by convention witho...

Update materialized view when urderlying tables change

I have a materialized view defined this way: CREATE MATERIALIZED VIEW M_FOO REFRESH COMPLETE ON COMMIT AS SELECT FOO_ID, BAR FROM FOO WHERE BAR IS NOT NULL GROUP BY FOO_ID, BAR / COMMENT ON MATERIALIZED VIEW M_FOO IS 'Foo-Bar pairs'; I wrote as a sort of cache: the source table is huge but the number of different pair...

Oracle refresh materialized view - Compile error

Hi, Im trying to execute a refresh on a materialized view, but I cant get the script to compile. CREATE OR REPLACE PROCEDURE REFRESH_MV AS BEGIN exec DBMS_MVIEW.REFRESH('my_mat_view_mv','C'); END REFRESH_MV; I get the message: ORA-06550: line 3, column 9: PLS-00103: Encountered the symbol "DBMS_MVIEW" when expecting one o...

Materialized view or CDC?

I have a view on two tables (stored using SQL 2008) with millions of records. CREATE VIEW VwSalesAge AS SELECT Transactions.ID ,Transactions.Amount ,Customer.ID ,Customer.Name ,Customer.Age FROM Transactions INNER JOIN Customer ON Transactions.CustomerID=Custo...

Incredibly slow Materialized View creation when using string aggregation, any performance suggestions?

Hi, I've got a load of materialized views, some of them take just a few seconds to create and refresh, whereas others can take me up to 40 minutes to compile, if SQLDeveloper doesn't crash before that. I need to aggregate some strings in my query, and I have the following function create or replace function stragg ( input varchar2 )...

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

Does MySQL have an equalavent to SQL Servers "indexed view" functionality? http://stackoverflow.com/questions/439056/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 underline view's query/sql. ...

How to implement Materialized View with MySQL?

How to implement Materialized Views? If not, how can I implement Materialized View with MySQL? Update: Would the following work? This doesn't occur in a transaction, is that a problem? DROP TABLE IF EXISTS `myDatabase`.`myMaterializedView`; CREATE TABLE `myDatabase`.`myMaterializedView` SELECT * from `myDatabase`.`myRegularView`; ...

Why use NoSQL over Materialized Views?

There has been a lot of talk recently about NoSQL. The #1 reason why I hear people use NoSQL is because they start to de-normalize their DBMS data so much so, to increase performance, that they end up with just one table with all of their data within that single table. With Materialized Views however, you can keep your data normalized,...

Select distinct ... inner join vs. select ... where id in (...)

I'm trying to create a subset of a table (as a materialized view), defined as those records which have a matching record in another materialized view. For example, let's say I have a Users table with user_id and name columns, and a Log table, with entry_id, user_id, activity, and timestamp columns. First I create a materialized view of...

Materialized Query Table in SQL Server 2005

In DB2 there is a support for Materialized Query Table (MQT). Basicly you write a query and create a MQT. But the difference from View is that the query is pre-executed and resulting data is stored in MQT and there are some options when to refresh/syncronize the MQT with base tables. I want same functionality in SQL Server. Is there a w...

On-demand refresh mode for indexed view (=Materialized views) on SQL Server?

I know Oracle offers several refreshmode options for their materialized views (on demand, on commit, periodically). Does Microsoft SQLServer offer the same functions for their indexed views? If not, how can I else use indexed views on SQLServer if my purpose is to export data on a daily+ on-demand basis, and want to avoid performance ov...

SQL Server indexed view matching of views with joins not working

Does anyone have experience of when SQL Servr 2008 R2 is able to automatically match indexed view (also known as materialized views) that contain joins to a query? for example the view select dbo.Orders.Date, dbo.OrderDetails.ProductID from dbo.OrderDetails join dbo.Orders on dbo.OrderDetails.OrderID = dbo.Orders.ID cannot be automat...

Materialized views and synonyms

Hi! Can anyone say Materialized view and Synonyms PROS and CONS? Best regards, Kristaps ...

MySQL VIEW vs. embedded query, which one is faster?

I'm going to optimize a MySQL embedded query with a view, but I'm not sure whether it will give an effect: SELECT id FROM (SELECT * FROM t); I want to convert it to: CREATE VIEW v AS SELECT * FROM t; SELECT id FROM v; I've heard about "indexed views" in SQL Server, but I'm not sure about MySQL. Any help would be appreciated. Thank...

Is it possible to set a primary key to a view?

Is it possible to set a primary key to a view in SQLServer 2008? ...

Can I set up materialised views on oracle for a SQL Server table over sqllink?

Hi, I have a table in a SQL Server database that needs to be visible to an oracle database. We have tried using a normal view over sqllink, but we are not able to create an onUpdate triggers on that view. I have read that we can create the trigger if it is a materialised view, but is unable to find any information on whether it can be ...

What is PCT for a materialized view?

Saw it in a reference manual. What is PCT for a materialized view? What is "Partition Change Tracking"? ...

MySQL: Materialized Views?

Possible Duplicate: Is it possible to have an indexed view in MySQL? Does MySQL support Materialized Views (for crazy fast SELECT performance)? If so, how do I create one? ...

Track changes on materialized views in Oracle

Hello, what is the best way to track changes of a materialized views in Oracle. I know, that triggers are available and CDC does not seem to work with materialized views. Are there any clever solutions? Thanks for your help Johannes ...

What drawbacks are there to maintaining a table of calculated records with triggers and FK constraints?

I have a table containing roles. Many users can be assigned to a role. Permissions can be assigned to a role, granting all users to that role with the permission. When I assign a permission to a role that has 500 hundred people, I've effectively created 500 permission assignments. With each permission that is assigned to a role I spe...