New Question Creation doesn’t work in anspress 4 with larger amount of posts

3.65K viewsCore
0

I went to create a new question on a large data set with anspress 4.  It doesn’t work and just hangs like this:

https://www.dropbox.com/s/lsor2dsvygjjomu/Screenshot%202017-01-30%2017.05.45.png?dl=0

Looking at the mysql.slow_log this seems to be the culprit.  It looks like the code that is creating the question for some reason needs to look up the new wp_posts.ID and its doing it off of the post_content field and post_type which seems really inefficient.

SELECT ID FROM wp_posts WHERE post_content = ‘go rosa’ AND post_type = ‘question’  LIMIT 1

The question looks like it technically gets correctly created but the SELECT after the creation hangs and so to the end user it looks like it failed.

Look like a duplicate check. Will try to disable duplicate check? But I dont this this could be issue as its a simple query. Did you checked what ajax response was after posting question?

How “large ammount of posts” is that ?

As you can see is very small query. I think this is not the reason behind OP’s issue. I think any PHP error causing AnsPress ajax response to corrupt and hence its not being redirected after posting a question.

0

Rahul – Can this be fixed in anspress4 as part of performance enhancements.  This is going to be very slow and unusable for anyone with large amounts of posts.

commented on answer

Lets talk on skype