Tariq
Tariq

Reputation: 2871

What is better: use find_in_set OR built another table?

I have an app with users and clients.
I need to create permissions for each user If he has access to all clients or some of them.

I am confused between:

Can you help me decide what's better for performance?

Upvotes: 2

Views: 411

Answers (1)

Lukasz Szozda
Lukasz Szozda

Reputation: 175994

First of all you are using Relational Database. There is something called First Normal Form [1NF]

I strongly recommend to read about Database Normalization:

A database is in first normal form if it satisfies the following conditions:

Contains only atomic values

There are no repeating groups

and:

An atomic value is a value that cannot be divided.

So instead of adding new column with comma separated values create new table.

Upvotes: 4

Related Questions