R
R
Roquie2014-09-12 19:09:06
PHP
Roquie, 2014-09-12 19:09:06

Which is faster: data processing in pgsql or php?

There are 2 tables with a huge amount of data (details, statistics). Is it worth it to join and write data processing and formatting in pgsql (so that the data is displayed directly on the site.)? or is it better to run foreach in php doing the same, but the select will be simple?
* it is worth considering that the processing will be quite complex, with mathematical functions, multiple concatenation and data transformation

Answer the question

In order to leave comments, you need to log in

5 answer(s)
S
sim3x, 2014-09-12
@Roquie

As for data sampling without processing it, do it using simple postgre procedures. As
for business logic, write in the language in which it is easier to write tests . You
will have to rewrite the code several times, regardless of your qualifications.

S
Sali_cat, 2014-09-14
@Sali_cat

Compile through c and run through sphenx) The speed will be ..)

A
Andrey Burov, 2014-09-12
@BuriK666

postgres will be faster. IMHO.

V
Vladimir, 2014-09-12
@rostel

compare

S
Stan_1, 2014-09-14
@Stan_1

I have been dealing with this issue for a long time. As a result, I adopted the formula for myself: "simple SELECT + processing in the backend". Reasons:
1. More maintainable code - the execution logic is not scattered in two places, but all sits in the BackEnd
2. There were problems with warming up - it's easier to pull two tables separately than one through JOIN. It turns out faster on primary data access.
3. Easier debugging and bug fixing, easier functionality extension

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question