I need to index a column in my SQL DB. There is one way to use a SQL query to create the index on a particular column
CREATE INDEX index_name
ON table_name (column1, column2, ...);
Another way I found on the internet is the use of something like this in JPA
@Table(indexes = @Index(columnList = "firstName"))
Is there any difference between the two? If JPA approach is being followed in real world won't it try to create index each time the project is deployed?