Skip to content
Advertisement

Does DB2 implement multi-table indexes?

I’m afraid this functionality may not exist [yet]. I wanted to use an index that spans multiple tables in DB2. I know Oracle and SQL server implement them (with more or less options) and that PostreSQL doesn’t seem to implement them yet.

Note: I asked a similar question about PosgreSQL a few weeks ago.

A multi-table index could be very beneficial for some specific queries.

For reference, here are the multi-table index examples for Oracle and SQL Server:

Oracle Example

Oracle can create bitmap join indexes, as shown below:

SQL Server Example

SQL Server can create indexed views:

Is there anything similar in DB2?

Advertisement

Answer

Db2 (for Linux, UNIX, and Windows) supports indexes on tables, i.e., you can only index a single table.

The table can be a MQT (materialized query table) which could be based on a view. This is different from indexing multiple tables directly.

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement