Skip to content

Add cart_rule column total_quantity#1693

Open
jolelievre wants to merge 1 commit into
PrestaShop:devfrom
jolelievre:add-discount-total-quantity
Open

Add cart_rule column total_quantity#1693
jolelievre wants to merge 1 commit into
PrestaShop:devfrom
jolelievre:add-discount-total-quantity

Conversation

@jolelievre
Copy link
Copy Markdown
Contributor

Questions Answers
Description? Add cart_rule column total_quantity, related to PrestaShop/PrestaShop#40830
Type? improvement
BC breaks? no
Deprecations? no
Fixed ticket? ~
Sponsor company ~
How to test? ~

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Mar 4, 2026

Comment thread upgrade/sql/9.2.0.sql
@ga-devfront
Copy link
Copy Markdown
Contributor

any news about that still the PR has been merged ? (Rebase needed)

@Quetzacoalt91 Quetzacoalt91 removed the enhancement Type: Improvement label Apr 7, 2026
@jolelievre jolelievre force-pushed the add-discount-total-quantity branch from 94189b7 to c772fea Compare April 9, 2026 14:38
@jolelievre
Copy link
Copy Markdown
Contributor Author

@ga-devfront yes the PR was merged, I didin't find the time to finish this one though, the structure is ok But I also need to compute extra data

@jolelievre jolelievre force-pushed the add-discount-total-quantity branch from c772fea to 56967f5 Compare April 9, 2026 21:32
@jolelievre jolelievre removed the wip label Apr 9, 2026
@jolelievre
Copy link
Copy Markdown
Contributor Author

@ga-devfront all good now

@jolelievre jolelievre force-pushed the add-discount-total-quantity branch from 56967f5 to 51f1906 Compare April 9, 2026 21:35
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Apr 9, 2026

Comment thread upgrade/sql/9.2.0.sql
Comment on lines +15 to +16
LEFT JOIN (
SELECT ocr.`id_cart_rule`, COUNT(*) as quantity_used
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering the impact of having a nest subquery when running it on large tables.

Copy link
Copy Markdown
Member

@Quetzacoalt91 Quetzacoalt91 Apr 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Look fine

+------+-------------+------------------+--------+-----------------------+---------+---------+-----------------------------+------+----------------------------------------------+
| id   | select_type | table            | type   | possible_keys         | key     | key_len | ref                         | rows | Extra                                        |
+------+-------------+------------------+--------+-----------------------+---------+---------+-----------------------------+------+----------------------------------------------+
|    1 | PRIMARY     | cr               | ALL    | NULL                  | NULL    | NULL    | NULL                        |    1 | Using where                                  |
|    1 | PRIMARY     | <derived2>       | ref    | key0                  | key0    | 5       | psreference.cr.id_cart_rule |    2 |                                              |
|    2 | DERIVED     | ocr              | ALL    | id_order,id_cart_rule | NULL    | NULL    | NULL                        |    1 | Using where; Using temporary; Using filesort |
|    2 | DERIVED     | o                | eq_ref | PRIMARY,current_state | PRIMARY | 4       | psreference.ocr.id_order    |    1 | Using where                                  |
|    3 | SUBQUERY    | ks_configuration | ref    | name                  | name    | 1018    | const                       |    1 | Using where                                  |
+------+-------------+------------------+--------+-----------------------+---------+---------+-----------------------------+------+----------------------------------------------+

We don't have a DEPENDENT SUBQUERY in the list. The subrequest is made once.

@ps-jarvis ps-jarvis added the Waiting for QA Status: Action required, Waiting for test feedback label Apr 20, 2026
@ps-jarvis ps-jarvis moved this from Ready for review to To be tested in PR Dashboard Apr 20, 2026
@Quetzacoalt91 Quetzacoalt91 added Waiting for rebase and removed Waiting for QA Status: Action required, Waiting for test feedback labels May 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: To be tested

Development

Successfully merging this pull request may close these issues.

4 participants