Tryton - Issues

 

Message55511

Author ced
Recipients pokoli, reviewbot
Date 2020-02-21.17:22:43
Content
Indeed I said that (everyone has contradiction) but there we were talking about synchronizing all the template field to the product. Here it is only one code.

Now about the benchmark.
I find that above 20ms such simple query should be considered as slow (usually we configure logging at this threshold).
So for me, all your queries are too slow for production use case.

If you create the proper index:

    create index  product_product_code_index ON product_product(code text_pattern_ops);

The code search become really fast. I have a factor of 1000 between both queries and with '=' operator it is 10000.
You got similar result with the standard index and '=' or 'in' operator which will be used more often in the web shop context.

And if you increase the factor of variant, it become worst. I get a factor of 10  with your benchmark with 100000 template and 50x variant. And I got a factor of 10000 with the proper index.

So of course it will always be faster if we get a proper index. But the materialized view will not be easy to implement and will still require a join which will be performance killing if the query has large result (or clause that can not be injected to the materialized view subquery).

Another point is the ability to create a unique constraint on product code, that's why I linked the issue9004.

In conclusion, I think it worth the data duplication in this case considering that product and template code are fields that will be very rarely changed.
History
Date User Action Args
2020-02-21 17:22:44cedsetmessageid: <1582302164.35.0.461527585825.issue9080@tryton.org>
2020-02-21 17:22:44cedsetrecipients: + pokoli, reviewbot
2020-02-21 17:22:44cedlinkissue9080 messages
2020-02-21 17:22:43cedcreate

Showing 10 items. Show all history (warning: this could be VERY long)