I used magento 2.1.5.

And I found the order increment id is not continuous.

Order increment id, increment to 75.

But the order id only 19.

So, why sequence_order_1 has many useless data?

Supplementary explanation

I used magento 2.1.5 to build a website.

I found that my order ID is not continuous, there will be an indefinite number of cross.

For example, the current order from the ID is 0000052, the next one is 0000062. Why is this?

I see through the phpmyadmin data table found, sequence_order_1 in the data will be a lot of useless.

My question is why the table(sequence_order_1) will be so abnormal.


1 Answer 1


Did you check the table column sales_sequence_profile.step ? It's used for increment id and should be set to 1.

Also check Magento\SalesSequence\Model\Sequence, method:

private function calculateCurrentValue()
    return ($this->lastIncrementId - $this->meta->getActiveProfile()->getStartValue())
    * $this->meta->getActiveProfile()->getStep() + $this->meta->getActiveProfile()->getStartValue();

I hope it helps.

  • I checked sales_sequence_profile.step is 1. Will there be other operations that will lead to an increase in ID?
    – dosenje
    Commented Aug 28, 2017 at 7:11
  • @dosenje did you also check the method calculateCurrentValue() to know the values Magento is using to generate the next increment id? You can debug it or dump the values to a log file. Commented Aug 28, 2017 at 11:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.