简体   繁体   中英

SQL Server Indexes with Included Columns - convert to Oracle

I'm totally new to SQL Server. Currently have to convert tables, indexes, triggers and more to Oracle. As far as I know there is no such thing as INCLUDE in Oracle. How to convert Indexes with Included Columns to Oracle index please?

CREATE NONCLUSTERED INDEX [index_name] 
    ON [dbo].[table_name] ([col1] ASC, [col2] ASC)
    INCLUDE ([col3], [col4]) 
    WITH (PAD_INDEX  = OFF...

This is the standard Oracle syntax:

CREATE INDEX index_name ON table_name (col1, col2);

Should I simply add col3 and col4 to my index?

There is no SQL Server version. All I get is files and converting all manually. Thank you All.

In theory that should work. Include'd columns mean they are not used as predicates during the index seeks (either in join conditions or the where clause), but the data in those columns is available to be returned without a key lookup.

Add the included columns at the end of the existing keys. Make sure you test out speed and index size as well.

Indexes with Included Columns

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM