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()
?
Advertisement
Answer
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.