- According to active spot, instead of LIKE you can use ILIKE PostgreSQL, you can understand that ILIKE can be used to change the case from upper to lower or vice versa. Still, by using ILIKE, you can see that the ILIKE is a slower process, now let us assume that ILIKE used for extended expressions then it consumes a lot of time. So, to overcome this, it is wise to use LOWER() Function, which is way faster than the ILIKE function.
Syntax:
SELECT id FROM groups where name ILIKE 'name.'
Hence, you can use this, but this is way slower than case_insensitive query.
- Case_insensitive query used to change the case of the name as required from lower to upper or vice versa. Moreover, this is faster as compared to ILIKE and LIKE.
Syntax:
SELECT id FROM groups WHERE LOWER(name) = 'name';