I have this code $table->integer('card_id')->unsigned()->index();
in a table that I created using Laravel framework. Just to make sure what does the index()
?
It's the way to say to the Laravel Migration to add indices to that column, in order to get faster results when searching through that particular column.
It's a common procedure in DB design when building tables. Just "index" some particular columns if you plan to make searchs in the table using those columns.
I just realized you added that "indexing" tag to your question and that the description of that tag answers your question.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With