Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding nonclustered Index with INCLUDE. #473

Open
btagliani opened this issue May 16, 2016 · 3 comments
Open

Adding nonclustered Index with INCLUDE. #473

btagliani opened this issue May 16, 2016 · 3 comments

Comments

@btagliani
Copy link

Hi everyone! I was wondering if there's any way to create an index like this:
CREATE NONCLUSTERED INDEX IndexName ON [dbo].[table] ([id],[type],[for_type],[attrib]) INCLUDE ([for_id],[value])
with ActiveRecord?

@metaskills
Copy link
Member

Just use the execute method in migrations when you need to do anything off the beaten path.

@erlingur
Copy link

@metaskills This is now supported from Rails but when running this the index does not get correctly created with the INCLUDE. Which means it will not be supported in the schema.rb file which means you have to find a way to somehow run a separate script to set these covering indexes up after a new installation.

rails/rails#44803

It would be great if this gem could support this. I have a performance issue in an app that I need to solve with covering indexes and having this built into the schema.rb file would be great.

@erlingur
Copy link

erlingur commented Feb 4, 2025

@aidanharan Thank you for reopening this! :) Hopefully this can get integrated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants