The order administration views are slow when there are large numbers of orders.

Performance can be greatly improved by adding some indexes to the order table.

Comments

dwkitchen’s picture

StatusFileSize
new1.22 KB

Patch attached to add 4 index based on those on the node table.

rszrama’s picture

Category: Bug report » Feature request
Status: Active » Needs review

I think we want to add indexes lightly... I seem to recall creating issues for sites in the past with large numbers of entities when we added an index. I think we need to do a bit of review that gives us an idea for how expensive this operation is, because it may need to be an opt-in for existing sites instead of an automatic update.

joelpittet’s picture

Issue tags: +needs profiling

Maybe this would be easier to get in with some profiling results before and after on each of the index in a common scenario for each?

Likely a good idea to be selective about which fields to index. Order type looks particularity case specific.

favrik’s picture

+1

Recently, I needed to pull some orders for sending abandoned cart emails, and wanted to check the `created` column, which does not have an index.

chris matthews’s picture

Status: Needs review » Needs work
Issue tags: +Needs reroll

The 4 year old patch to commerce_order.install does not apply to the latest commerce 7.x-1.x-dev and needs a reroll.

khiminrm’s picture

khiminrm’s picture

Status: Needs work » Needs review
khiminrm’s picture

fixed names

khiminrm’s picture

kapilv’s picture

Issue tags: -Needs reroll
danmer’s picture

Status: Needs review » Reviewed & tested by the community

Tested. Patch from comment #8 works as expected.

rszrama’s picture

Status: Reviewed & tested by the community » Fixed

Thanks! Rerolled this to increment the update hook number to 7113 and add a settings based override to disable adding the indexes via the update function. With millions of rows, this could be quite a costly update. 😬

Committed!

  • rszrama committed ca15fd2 on 7.x-1.x authored by khiminrm
    Issue #2445001 by khiminrm, dwkitchen, rszrama, danmer: Add additional...

  • rszrama committed fa29354 on 7.x-1.x
    Issue #2445001 follow-up by rszrama: correct the logic in the skip...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.