Issue Feature Closed

#23087FIND_IN_SET should be used instead of complicated LIKE where clause

Xavier Perseguers 07/03/10, 13:22 updated 01/31/11, 16:10

Description

MySQL supports the FIND_IN_SET operator to efficiently find records having a given value in a set of values (comma-separated list of values). This is typically used with usergroups. This method should be used instead of doing some complicated LIKE query.

Solution:
Enhance the SQL query to support this operator and rewrite it if needed for other DBMS. Use a dedicated DBMS function whenever possible (PostgreSQL / MSSQL). For instance:

MSSQL: http://mschat.net/blog/index.php?topic=8
PostgreSQL: http://archives.postgresql.org/pgsql-sql/2009-12/msg00033.php

(issue imported from #M14985)

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.