We have observed one problem in Postgresql as it doesn't uses multi core of CPU for single query. For example, I have 8 cores in cpu. We are having 40 Million entries in stock.move table. When we apply massive query in single database connection to generate reporting & observe at backend side, we see only one core is 100% used, where as all other 7 are free. Due to that query execution time takes so longer and our odoo system being slow. Whereas problem is inside postgresql core. If by anyhow we can share a query between two or more cores than we can get performance boost in postgresql query execution.
I am sure by solving parallel query execution, we can make Odoo performance even faster. Anyone has any kind of suggestions regarding this ?
------------------- * Editing this question to show you answer from Postgresql Core committee *------------------------------------
Here I am posting the answer which I got from one of top contributor of Postgresql database. ( I hope this information will be useful)
Hello Hiren,
It is expected behave. PostgreSQL doesn't support parallel CPU for single query. This topic is under high development, and probably, this feature will be in planned release 9.6 ~ September 2016.
But table with 40M rows isn't too big, so probably more CPU should not too help to you (there is some overhead with start and processing multi CPU query). You have to use some usual tricks like materialized view, preagregations, ... the main idea of these tricks - don't try to repeat often same calculation. Check health of PostgreSQL - indexes, vacuum processing, statistics,.. Check hw - speed of IO. Check PostgreSQL configuration - shared_buffers, work_mem. Some queries can be slow due bad estimations - check a explain of slow queries.
There are some tools that can breaks some query to more queries and start parallel execution, but I didn't use it.
https://launchpad.net/stado
http://www.pgpool.net/docs/latest/tutorial-en.html#parallelRegardsPavel Stehule
@Emipro this is actually a great question.. I've seen multiple topics about these things but never a good and solid answer. You should contact Olivier Dony or Antony Lessuise from Odoo, those guys know a lot about this and I'm sure they can help you in the good way. (Don't forget to post back here)
@yenthe I have personally asked this question to Fabian and one of the other technical developer during Odoo Experience 2015 but they didn't gave any satisfactory answer. However it may happen that this is not topic of their interest. So I asked this question to one of top contributor of Postgresql core committee. ( just got before 15 minutes from now ) Let me edit my question and add their answer. So may be some guys from Odoo will be interested. Please look at my question to know answer from Postgresql side.
Thanks for the update! Regarding the statement about postgreSQL.. "PostgreSQL doesn't support parallel CPU for single query." Well, then you're done unless you would like to expand / tweek the whole postgreSQL system.I would assume that Odoo would jump on these features if they're launched in postgreSQL 9.6 though. (which is still a long time away)
@Yenthe one guy from PostgreSQL suggested me to look on this link for parallel query execution, Postgres-XL: http://www.postgres-xl.org/
Yes are also facing this issue