Answer the question
In order to leave comments, you need to log in
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
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.
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 questionAsk a Question
731 491 924 answers to any question