- Mailing Lists
- Contributors
- Re: Postgresql Table partitioning in Odoo
Archives
- By thread 1419
-
By date
- August 2019 59
- September 2019 118
- October 2019 165
- November 2019 97
- December 2019 35
- January 2020 58
- February 2020 204
- March 2020 121
- April 2020 172
- May 2020 50
- June 2020 158
- July 2020 85
- August 2020 94
- September 2020 193
- October 2020 277
- November 2020 100
- December 2020 159
- January 2021 38
- February 2021 87
- March 2021 146
- April 2021 73
- May 2021 90
- June 2021 86
- July 2021 123
- August 2021 50
- September 2021 68
- October 2021 66
- November 2021 74
- December 2021 75
- January 2022 98
- February 2022 77
- March 2022 68
- April 2022 31
- May 2022 59
- June 2022 87
- July 2022 141
- August 2022 38
- September 2022 73
- October 2022 152
- November 2022 39
- December 2022 50
- January 2023 93
- February 2023 49
- March 2023 106
- April 2023 47
- May 2023 69
- June 2023 92
- July 2023 64
- August 2023 103
- September 2023 91
- October 2023 101
- November 2023 94
- December 2023 46
- January 2024 75
- February 2024 79
- March 2024 104
- April 2024 63
- May 2024 40
- June 2024 160
- July 2024 80
- August 2024 70
- September 2024 62
- October 2024 121
- November 2024 117
- December 2024 89
- January 2025 59
- February 2025 104
- March 2025 96
- April 2025 107
- May 2025 52
- June 2025 72
- July 2025 60
- August 2025 81
- September 2025 124
- October 2025 63
- November 2025 22
Contributors
Re: Postgresql Table partitioning in Odoo
Hi,It's not really practical unfortunately. You can't just decide to use partitions. Well I suppose maybe you could rename the existing table, create a new one partitioned and then attach the renamed table as a partition if you were doing partition by date or id. I think a lot of the problem with aml in particular is the rows have gotten very wide as well.Materialized views, partial indexes, clustering tables, even just good GIN indexing are all quite a lot simpler and can offer far better performance depending on need. Indeed I remember 8 or 9 years ago there was a popular module for account move lines which implemented what could best be described as homegrown matviews to store aggregate AML data. However, all these solutions are still constrained by Odoo 32 bit id's. So if by getting large you mean approaching the billions, then that's a new set of problems.There is one set of solutions which I'm quite interested in for performance. That is using logical BDR to partition the write server of multi master databases. It seems this is doable without too much change but Odoo's id model doesn't meet the requirements, needing either GUID or BIGSERIAL. My idea is essentially to partition tables say geographically on some field, say company id, or create_uid and then run local Odoo instances in those geographies with their own pg cluster but achieving global consistency.On Sat, Feb 27, 2021 at 8:17 AM Jordi Ballester Alomar <jordi.ballester@forgeflow.com> wrote:Dear contributors,We have a case of a database where some tables, like account.move.line are growing to absurd numbers of records. At this point we are considering using Postgresql Table partitioning to speed up performance. Has anyone of you had experience with table partitioning?Looking forward to hearing your thoughts.Regards,--Jordi Ballester AlomarCEO & Founder | ForgeFlow(+34) 629530707 | jordi.ballester@forgeflow.com | https://www.forgeflow.comTwitter: https://twitter.com/jordibforgeflow | Linkedin: https://www.linkedin.com/in/jordiballesteralomar_______________________________________________
Mailing-List: https://odoo-community.org/groups/contributors-15
Post to: mailto:contributors@odoo-community.org
Unsubscribe: https://odoo-community.org/groups?unsubscribe
_______________________________________________
Mailing-List: https://odoo-community.org/groups/contributors-15
Post to: mailto:contributors@odoo-community.org
Unsubscribe: https://odoo-community.org/groups?unsubscribe
by Jordi Ballester Alomar - 07:26 - 27 Feb 2021
Reference
-
Postgresql Table partitioning in Odoo
Dear contributors,We have a case of a database where some tables, like account.move.line are growing to absurd numbers of records. At this point we are considering using Postgresql Table partitioning to speed up performance. Has anyone of you had experience with table partitioning?Looking forward to hearing your thoughts.Regards,--Jordi Ballester AlomarCEO & Founder | ForgeFlow(+34) 629530707 | jordi.ballester@forgeflow.com | https://www.forgeflow.comTwitter: https://twitter.com/jordibforgeflow | Linkedin: https://www.linkedin.com/in/jordiballesteralomar
by Jordi Ballester Alomar - 08:16 - 26 Feb 2021-
Re: Postgresql Table partitioning in Odoo
Graeme,I have considered for example to create materialized views for aggregated data in connection with the financial reports, MIS Builder, etc. The drawback is that it essentially requires you to introduce a lot of changes to the application logic in order to make use of those materialized views. At this stage partitioning seems to me like a better idea, because the change is (almost) limited to the database, and you can continue to use the application as it has been designed.I'm not concerned (yet) by the 32 bits limitation of id's.On Sat, Feb 27, 2021 at 3:12 AM Graeme Gellatly <gdgellatly@gmail.com> wrote:Hi,It's not really practical unfortunately. You can't just decide to use partitions. Well I suppose maybe you could rename the existing table, create a new one partitioned and then attach the renamed table as a partition if you were doing partition by date or id. I think a lot of the problem with aml in particular is the rows have gotten very wide as well.Materialized views, partial indexes, clustering tables, even just good GIN indexing are all quite a lot simpler and can offer far better performance depending on need. Indeed I remember 8 or 9 years ago there was a popular module for account move lines which implemented what could best be described as homegrown matviews to store aggregate AML data. However, all these solutions are still constrained by Odoo 32 bit id's. So if by getting large you mean approaching the billions, then that's a new set of problems.There is one set of solutions which I'm quite interested in for performance. That is using logical BDR to partition the write server of multi master databases. It seems this is doable without too much change but Odoo's id model doesn't meet the requirements, needing either GUID or BIGSERIAL. My idea is essentially to partition tables say geographically on some field, say company id, or create_uid and then run local Odoo instances in those geographies with their own pg cluster but achieving global consistency.On Sat, Feb 27, 2021 at 8:17 AM Jordi Ballester Alomar <jordi.ballester@forgeflow.com> wrote:Dear contributors,We have a case of a database where some tables, like account.move.line are growing to absurd numbers of records. At this point we are considering using Postgresql Table partitioning to speed up performance. Has anyone of you had experience with table partitioning?Looking forward to hearing your thoughts.Regards,--Jordi Ballester AlomarCEO & Founder | ForgeFlow(+34) 629530707 | jordi.ballester@forgeflow.com | https://www.forgeflow.comTwitter: https://twitter.com/jordibforgeflow | Linkedin: https://www.linkedin.com/in/jordiballesteralomar_______________________________________________
Mailing-List: https://odoo-community.org/groups/contributors-15
Post to: mailto:contributors@odoo-community.org
Unsubscribe: https://odoo-community.org/groups?unsubscribe
_______________________________________________
Mailing-List: https://odoo-community.org/groups/contributors-15
Post to: mailto:contributors@odoo-community.org
Unsubscribe: https://odoo-community.org/groups?unsubscribe
--Jordi Ballester AlomarCEO & Founder | ForgeFlow(+34) 629530707 | jordi.ballester@forgeflow.com | https://www.forgeflow.comTwitter: https://twitter.com/jordibforgeflow | Linkedin: https://www.linkedin.com/in/jordiballesteralomar
by Jordi Ballester Alomar - 07:26 - 27 Feb 2021 -
Re: Postgresql Table partitioning in Odoo
Nhomar,In this case the account_move_line table is larger than 10 millions records. The company is using inventory accounting, and does a lot of inventory transactions. That does not help, as it creates a big number of inventory related AML's. I'd like to get rid of inventory accounting, of course! :)We refactored the OCA financial reports completely, for example, and certainly this has added a lot of benefits.What makes sense for me with partitioning a table, especially in accounting, is that you don't often make use of previous years move lines, except when you are computing an initial balance.I tried to manually transform the account_move_line to a partitioned table with success. See https://github.com/odoo/odoo/pull/66964. I would need to test with a large database now to check if this really brings the expected benefits.As Daniel Reis suggestested, using partial indexes seems interesting. However the Postgres recommends not to use them when partitioning really makes more sense. https://www.postgresql.org/docs/current/indexes-partial.html"If your table is large enough that a single index really is a bad idea, you should look into using partitioning instead (see Section 5.11). With that mechanism, the system does understand that the tables and indexes are non-overlapping, so far better performance is possible."Partitioning in odoo must be limited to using always the "id" column in the partitions, as the primary key must be contained in all partitions.On Fri, Feb 26, 2021 at 8:57 PM Nhomar Hernández <nhomar@vauxoo.com> wrote:How many records is for you **Absurd**.?
We try to fix odoo performance in the views or tools that are slow with records over between 1 and 10 millions.But not always touch postgres will help.. Did you make the measurement?El vie, 26 de feb. de 2021 a la(s) 13:17, Jordi Ballester Alomar (jordi.ballester@forgeflow.com) escribió:Dear contributors,We have a case of a database where some tables, like account.move.line are growing to absurd numbers of records. At this point we are considering using Postgresql Table partitioning to speed up performance. Has anyone of you had experience with table partitioning?Looking forward to hearing your thoughts.Regards,--Jordi Ballester AlomarCEO & Founder | ForgeFlow(+34) 629530707 | jordi.ballester@forgeflow.com | https://www.forgeflow.comTwitter: https://twitter.com/jordibforgeflow | Linkedin: https://www.linkedin.com/in/jordiballesteralomar_______________________________________________
Mailing-List: https://odoo-community.org/groups/contributors-15
Post to: mailto:contributors@odoo-community.org
Unsubscribe: https://odoo-community.org/groups?unsubscribe
--Nhomar G Hernández
Vauxoo | CEO
¡Construyamos algo genial!
Cel: +52 (477) 393.3942 | Telegram: nhomar | Twitter: @nhomarMéxico · Venezuela · Costa Rica · Perú
_______________________________________________
Mailing-List: https://odoo-community.org/groups/contributors-15
Post to: mailto:contributors@odoo-community.org
Unsubscribe: https://odoo-community.org/groups?unsubscribe
--Jordi Ballester AlomarCEO & Founder | ForgeFlow(+34) 629530707 | jordi.ballester@forgeflow.com | https://www.forgeflow.comTwitter: https://twitter.com/jordibforgeflow | Linkedin: https://www.linkedin.com/in/jordiballesteralomar
by Jordi Ballester Alomar - 07:21 - 27 Feb 2021 -
Re: Postgresql Table partitioning in Odoo
Hi,It's not really practical unfortunately. You can't just decide to use partitions. Well I suppose maybe you could rename the existing table, create a new one partitioned and then attach the renamed table as a partition if you were doing partition by date or id. I think a lot of the problem with aml in particular is the rows have gotten very wide as well.Materialized views, partial indexes, clustering tables, even just good GIN indexing are all quite a lot simpler and can offer far better performance depending on need. Indeed I remember 8 or 9 years ago there was a popular module for account move lines which implemented what could best be described as homegrown matviews to store aggregate AML data. However, all these solutions are still constrained by Odoo 32 bit id's. So if by getting large you mean approaching the billions, then that's a new set of problems.There is one set of solutions which I'm quite interested in for performance. That is using logical BDR to partition the write server of multi master databases. It seems this is doable without too much change but Odoo's id model doesn't meet the requirements, needing either GUID or BIGSERIAL. My idea is essentially to partition tables say geographically on some field, say company id, or create_uid and then run local Odoo instances in those geographies with their own pg cluster but achieving global consistency.On Sat, Feb 27, 2021 at 8:17 AM Jordi Ballester Alomar <jordi.ballester@forgeflow.com> wrote:Dear contributors,We have a case of a database where some tables, like account.move.line are growing to absurd numbers of records. At this point we are considering using Postgresql Table partitioning to speed up performance. Has anyone of you had experience with table partitioning?Looking forward to hearing your thoughts.Regards,--Jordi Ballester AlomarCEO & Founder | ForgeFlow(+34) 629530707 | jordi.ballester@forgeflow.com | https://www.forgeflow.comTwitter: https://twitter.com/jordibforgeflow | Linkedin: https://www.linkedin.com/in/jordiballesteralomar_______________________________________________
Mailing-List: https://odoo-community.org/groups/contributors-15
Post to: mailto:contributors@odoo-community.org
Unsubscribe: https://odoo-community.org/groups?unsubscribe
by Graeme Gellatly - 03:11 - 27 Feb 2021 -
Re: Postgresql Table partitioning in Odoo
Hello Jordi,In some cases Partial Indexes can do the trick.For example, you could have a partial index only for active records. Since most of the time there is filter condition on the active field, the smaller partial index can be used instead of a full index.This can give you the same benefits as a partitioned table, with a simpler solution (no need to push data around).More info:--drNo dia 26/02/2021, às 19:17, Jordi Ballester Alomar <jordi.ballester@forgeflow.com> escreveu:
Dear contributors,We have a case of a database where some tables, like account.move.line are growing to absurd numbers of records. At this point we are considering using Postgresql Table partitioning to speed up performance. Has anyone of you had experience with table partitioning?Looking forward to hearing your thoughts.Regards,--Jordi Ballester AlomarCEO & Founder | ForgeFlow(+34) 629530707 | jordi.ballester@forgeflow.com | https://www.forgeflow.comTwitter: https://twitter.com/jordibforgeflow | Linkedin: https://www.linkedin.com/in/jordiballesteralomar_______________________________________________
Mailing-List: https://odoo-community.org/groups/contributors-15
Post to: mailto:contributors@odoo-community.org
Unsubscribe: https://odoo-community.org/groups?unsubscribe
by Daniel Reis - 09:36 - 26 Feb 2021 -
Re: Postgresql Table partitioning in Odoo
How many records is for you **Absurd**.?
We try to fix odoo performance in the views or tools that are slow with records over between 1 and 10 millions.But not always touch postgres will help.. Did you make the measurement?El vie, 26 de feb. de 2021 a la(s) 13:17, Jordi Ballester Alomar (jordi.ballester@forgeflow.com) escribió:Dear contributors,We have a case of a database where some tables, like account.move.line are growing to absurd numbers of records. At this point we are considering using Postgresql Table partitioning to speed up performance. Has anyone of you had experience with table partitioning?Looking forward to hearing your thoughts.Regards,--Jordi Ballester AlomarCEO & Founder | ForgeFlow(+34) 629530707 | jordi.ballester@forgeflow.com | https://www.forgeflow.comTwitter: https://twitter.com/jordibforgeflow | Linkedin: https://www.linkedin.com/in/jordiballesteralomar_______________________________________________
Mailing-List: https://odoo-community.org/groups/contributors-15
Post to: mailto:contributors@odoo-community.org
Unsubscribe: https://odoo-community.org/groups?unsubscribe
--Nhomar G Hernández
Vauxoo | CEO
¡Construyamos algo genial!
Cel: +52 (477) 393.3942 | Telegram: nhomar | Twitter: @nhomarMéxico · Venezuela · Costa Rica · Perú
by Nhomar Hernández - 08:56 - 26 Feb 2021
-