wp query - update_post_meta performance in a loop woocommerce

I have a simple question, I am working on the list order screen of woocommerce and want to add some buttons that via aja

I have a simple question, I am working on the list order screen of woocommerce and want to add some buttons that via ajax will update some data to the database using update_post_meta. The issue is that these buttons are pressed with a frequency more or less 10 times/minute.

Can this generate any problem with the database?

If the answer is yes, what would be the best practice for this?

I thought that maybe I can update this data at the same time, however, if I put this in a loop:

loop of 40 items{
    update_post_meta
}

I think it will be worse, won't it?

I have a simple question, I am working on the list order screen of woocommerce and want to add some buttons that via ajax will update some data to the database using update_post_meta. The issue is that these buttons are pressed with a frequency more or less 10 times/minute.

Can this generate any problem with the database?

If the answer is yes, what would be the best practice for this?

I thought that maybe I can update this data at the same time, however, if I put this in a loop:

loop of 40 items{
    update_post_meta
}

I think it will be worse, won't it?

Share Improve this question asked Feb 8, 2019 at 16:29 federico sgoifofederico sgoifo 313 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

I think, an idea would be to save your values on a new small table with all you need, and have a script that once every "n" hours update all metas.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745549136a4632482.html

相关推荐

  • wp query - update_post_meta performance in a loop woocommerce

    I have a simple question, I am working on the list order screen of woocommerce and want to add some buttons that via aja

    18小时前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信