T
T
trevin2017-10-11 17:48:26
PHP
trevin, 2017-10-11 17:48:26

Which is faster with PHP 7.0 or MySQL 5.7 json data?

There are about 10,000 records in MySQL, you need to select all of them, a few columns and some data from a json field.
Which of the following will be faster?
1) Select all the data from the json field with a query, then pull out the necessary values ​​in php
2) Extract the necessary values ​​from the json field using MySQL?
Maybe there are other options?
If you do not know the answer, tell me how to test?
Thanks in advance

Answer the question

In order to leave comments, you need to log in

3 answer(s)
D
Dmitry Dart, 2017-10-11
@trevin

Pull out using MySQL, so in addition, reduce the traffic between the database and the application.

B
Boris Korobkov, 2017-10-11
@BorisKorobkov

If this is a one-time operation (migration), then do what is more convenient (it's faster to write code).
If this is a regular operation, then you need to make the correct database structure.

D
Denis Popov, 2017-11-23
@DenisDangerous

I think php is easier. ran through json_decode and take what you need

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question