0 votes

We can define some indexes for any table in ORM-Designer. What is the performance of indexes? How use it?

in How To & Manuals by
edited by

1 Answer

0 votes
Best answer

It depends on ORM framework you're using but in general indexes serve to index data in your database. If you define index for any field, you can perform faster data look-up on this field.

For example for Doctrine2 indexes, take a look at following Doctrine2 documentation page, for Doctrine1 check this page.

by Skipper developer (141k points)

I work with Doctrine2. can you Explain this code?
What is the meaning of "columns" feature in this code?

indexes={@Index(name="user_idx", columns={"email"})}

This code snippet means that you're defining index with name user_idx on columns "email". This means the column "email" will be indexed on your database storage.

For more details how to specify index on Doctrine2 and how database indexes work please check Doctrine2 and database documentation or another relevant forums.

For example here is a question about database indexes and here are another topics: