If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > db2 indexed views?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-30-10, 12:14
rogue49 rogue49 is offline
Registered User
 
Join Date: Oct 2003
Location: Near D.C.
Posts: 47
db2 indexed views?

Haven't found it.
Does DB2 LUW Enterprise 9.7 have indexed views?

Or if not, is there likely idea in a near future version?



Thanks for any feedback.

/long-time DBA, now knee-deep in DB2...
Reply With Quote
  #2 (permalink)  
Old 07-30-10, 12:18
Lenny77 Lenny77 is offline
Registered User
 
Join Date: Jul 2009
Location: NY
Posts: 886
Views are the virtual tables and therefore using the indexes of the tables which consist in create views statements.

Lenny
Reply With Quote
  #3 (permalink)  
Old 07-30-10, 12:25
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
You can achieve the functionality similar to MS SQL Server indexed views by creating DB2 materialized query tables and building indexes upon them.
Reply With Quote
  #4 (permalink)  
Old 07-30-10, 12:56
rogue49 rogue49 is offline
Registered User
 
Join Date: Oct 2003
Location: Near D.C.
Posts: 47
Quote:
Originally Posted by n_i View Post
You can achieve the functionality similar to MS SQL Server indexed views by creating DB2 materialized query tables and building indexes upon them.
that's something to consider, thanks much.
Reply With Quote
  #5 (permalink)  
Old 07-30-10, 14:49
Lenny77 Lenny77 is offline
Registered User
 
Join Date: Jul 2009
Location: NY
Posts: 886
Arrow Fyi

Quote:
Originally Posted by rogue49 View Post
that's something to consider, thanks much.
MQT is NOT a VIEW. You have to execute REFRESH TABLE mqt_tbl
before retrieve information from mqt_tbl table.

Lenny
Reply With Quote
  #6 (permalink)  
Old 07-30-10, 15:10
rogue49 rogue49 is offline
Registered User
 
Join Date: Oct 2003
Location: Near D.C.
Posts: 47
Quote:
Originally Posted by Lenny77 View Post
MQT is NOT a VIEW. You have to execute REFRESH TABLE mqt_tbl
before retrieve information from mqt_tbl table.

Lenny
But that's not the point of what I'm going after, whether something is a literally a view or not.
But something that allows me to apply indexing to standing SQL statements to potentially optimize the performance of its results.
Not guaranteed, but I'm trying to consider my options and think outside the box.

MQT, Materialized View, Indexed View...

I believe the gentleperson's answer gave me an option to the situation that was inferred in the question.

But thanks for the input, I do appreciate it.
Reply With Quote
  #7 (permalink)  
Old 07-30-10, 15:26
dbzTHEdinosaur dbzTHEdinosaur is offline
Registered User
 
Join Date: Jun 2007
Location: germany
Posts: 96
rogue49
Location: Near D.C
- or -
DMV?
__________________
Dick Brenholtz, Ami in Deutschland
Reply With Quote
  #8 (permalink)  
Old 07-30-10, 15:33
rogue49 rogue49 is offline
Registered User
 
Join Date: Oct 2003
Location: Near D.C.
Posts: 47
Quote:
Originally Posted by dbzTHEdinosaur View Post
rogue49
Location: Near D.C
- or -
DMV?
Live MD of the DMV was VA
Work DC...I'd tell you where, but I'd have to kill you.
Reply With Quote
  #9 (permalink)  
Old 07-30-10, 16:14
Lenny77 Lenny77 is offline
Registered User
 
Join Date: Jul 2009
Location: NY
Posts: 886
Arrow Fyi-2

Quote:
Originally Posted by rogue49 View Post
But that's not the point of what I'm going after, whether something is a literally a view or not.
But something that allows me to apply indexing to standing SQL statements to potentially optimize the performance of its results.
Not guaranteed, but I'm trying to consider my options and think outside the box.

MQT, Materialized View, Indexed View...

I believe the gentleperson's answer gave me an option to the situation that was inferred in the question.

But thanks for the input, I do appreciate it.
MQT is working faster than view (with the same structure), but REFRESH could take a long time.

Lenny
Reply With Quote
  #10 (permalink)  
Old 07-30-10, 17:58
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
Quote:
Originally Posted by Lenny77
You have to execute REFRESH TABLE mqt_tbl
before retrieve information from mqt_tbl table.
Quote:
Originally Posted by Lenny77 View Post
MQT is working faster than view (with the same structure), but REFRESH could take a long time.
Both these statements, like all hasty generalizations, may prove incorrect under certain conditions.
Reply With Quote
  #11 (permalink)  
Old 07-30-10, 18:04
Lenny77 Lenny77 is offline
Registered User
 
Join Date: Jul 2009
Location: NY
Posts: 886
Cool

Quote:
Originally Posted by n_i View Post
Both these statements, like all hasty generalizations, may prove incorrect under certain conditions.
Everything is possible !

Lenny
Reply With Quote
  #12 (permalink)  
Old 07-30-10, 18:16
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
Quote:
Originally Posted by Lenny77 View Post
Everything is possible !
Another hasty generalization.
Reply With Quote
  #13 (permalink)  
Old 07-30-10, 23:24
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,198
Quote:
Originally Posted by Lenny77 View Post
MQT is NOT a VIEW. You have to execute REFRESH TABLE mqt_tbl
before retrieve information from mqt_tbl table.

Lenny
You only have to explicitly issue the refresh one time (right after you create the MQT) if you define the MQT as system maintained. Thereafter, DB2 will automatically keep the MQT in synch with the base table. Obviously, you might not want an MQT to be system maintained if there were a lot of changes being made to the base table and the MQT was a summary table.
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On