Jump to content

Array or multiple rows?


weee

Recommended Posts

I have a quick question in regards to which method is "faster".

 

So I want to make a list with multiple "indexes" to be looked up in another table.

 

Is it faster to store an array like 1;2;3;4;5;6;7 in a "TEXT" column and then explode on the ; and compare IDs with a previous query with all of the information

or

store each number in its own row and have it look up all the information at once?

Primary key | number

1 | 1

2 | 2

3 | 3

7 | 4

8 | 5

10 | 7

and do a left join on each number and have it looked all the info at once?

 

So which do you think is the better method?

 

Thanks!

weee

Link to comment
https://forums.phpfreaks.com/topic/222536-array-or-multiple-rows/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.