Replies: 1 comment 3 replies
-
Sorry, but I think your suggestion is wrong and the current code is correct. It makes no sense to do It makes some sense to do I think you have mis-interpreted the use the index article because the current code seems to me to be following the advice given there. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
As I have learned, the order of columns in multi-column index matters. The most unique columns should go first. Here is an article about that: https://use-the-index-luke.com/sql/where-clause/the-equals-operator/concatenated-keys
Here is an example of a migration:
The method
morphs()
calls the methodnumericMorphs()
which looks like this:I suggest the
{$name}_id
column to go before the{$name}_type
column in that index. 🤔Beta Was this translation helpful? Give feedback.
All reactions