The effects of alcohol on sustanon 250 leucine for – real weight loss & bodybuilding benefits?
Search
Close
AI Search
Classic Search
 Search Phrase:
 Search Type:
Advanced search options
 Search in Forums:
 Search in date period:

 Sort Search Results by:

Filter by custom fields

Topic prefix

AI Assistant
Notifications
Clear all

SQL

4 Posts
2 Users
0 Reactions
1,339 Views
(@isrdll)
Posts: 4
Active Member
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
 
[#3213]

The following SQL query uses "NOT IN" and takes a long time to process if there are a large number of comments. Can you improve it?

 

SELECT SQL_CALC_FOUND_ROWS wp_comments.comment_ID
FROM wp_comments
WHERE ( ( comment_approved = '0'
OR comment_approved = '1' ) )
AND comment_post_ID = 22849
AND comment_type NOT IN ('wpdiscuz_sticky')
AND comment_parent = 0
ORDER BY wp_comments.`comment_ID` asc
LIMIT 0,11

 

  • WpdiscuzCore->_getWPComments()
    wp-content/plugins/wpdiscuz/class.WpdiscuzCore.php:827
  • WpdiscuzCore->getWPComments()
    wp-content/plugins/wpdiscuz/class.WpdiscuzCore.php:774

 
Posted : 28/09/2021 10:46 am
Asti
 Asti
(@asti)
Posts: 8257
Illustrious Member Support
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
 

We'll discuss this with our team and take it into consideration for future versions. 


In case you want to say thank you! 🙂
We'd really appreciate if you leave a good review on the plugin page.
This is the best way to say thank you to this project and the support team.

 
Posted : 28/09/2021 12:39 pm
(@isrdll)
Posts: 4
Active Member
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
 

@asti 

The following query is also slow.

WpdiscuzCore->getStickyComments():

SELECT SQL_CALC_FOUND_ROWS wp_comments.comment_ID
FROM wp_comments
WHERE ( ( comment_approved = '0'
OR comment_approved = '1' ) )
AND comment_post_ID = 23016
AND comment_type IN ('wpdiscuz_sticky')
AND comment_parent = 0
ORDER BY wp_comments.`comment_ID` asc

When I create "comment_type" index on "comments" table, WpdiscuzCore->getStickyComments() improves the speed, but the first query I presented does not improve the speed. Probably because using "NOT IN".


 
Posted : 28/09/2021 6:11 pm
(@isrdll)
Posts: 4
Active Member
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
 

@asti

And I don't want to create a "comment_type" index, because I never use "stick" and there are no "wpdiscuz_sticky" comments in the "comments" table.


 
Posted : 28/09/2021 6:20 pm