Ask Your Question
2

Is it possible to make MySQL's FIND_IN_SET function or a comparable function utilize indices?

asked 2021-12-02 11:00:00 +0000

woof gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2022-09-02 01:00:00 +0000

scrum gravatar image

Unfortunately, FINDINSET function cannot utilize indices in MySQL. This is because FINDINSET function is not a deterministic function, which means that it can return different results for the same input values. Therefore, MySQL does not allow the use of indexes on columns used in FINDINSET function. To improve performance, you may consider redesigning the table schema or using a different approach such as creating a separate table to store the sets and performing a JOIN operation.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2021-12-02 11:00:00 +0000

Seen: 10 times

Last updated: Sep 02 '22