q2a / question2answer

Question2Answer is a free and open source platform for Q&A sites, running on PHP/MySQL.
http://www.question2answer.org/
GNU General Public License v3.0
1.63k stars 628 forks source link

qa_update_counts_for_q cost much time when we have large num of posts #943

Closed ZhaoGuangYue1986 closed 1 year ago

ZhaoGuangYue1986 commented 2 years ago

When create / hide / delete quesions , we will call funtion qa_update_counts_for_q to recout numbers . I found when the db have large numbers of posts ,this founction will cost much time. I think we should optimize this fouction

svivian commented 1 year ago

Several performance improvements have been made recently which should make that function much faster. If you're able to test with the latest version of the 'bugfix' branch that would be great. If it's still slow I can reopen this issue.