laravel / ideas

Issues board used for Laravel internals discussions.
939 stars 28 forks source link

Feature request: support index algorithms for migrations using Schema Blueprint (or add documentation) #2385

Open k98kurz opened 4 years ago

k98kurz commented 4 years ago

Currently, the indexes created via Laravel migrations (using Blueprint) seem to exclusively use btree, and I can find no documented way to override this behavior. ~I propose adding a second, optional parameter to the index, unique, etc calls that change the type of index algorithm to be specified in the USING clause.~ After some more searching, I found that the index method does accept an algorithm param, but its behavior is nowhere documented. I propose documenting what the algorithm parameter actually does.

The rationale for this is that some inserts will fail when the data to be inserted into a jsonb column exceeds the limits of a btree index. I will need to experiment with gin and gist index algorithms, but I am unsure if the Schema Blueprint system can handle this due to lack of documentation on the algorithm parameter.