Support Forum

RSS creates long and slow query errors

52 Answers

New Answer

YS Yellow Swordfish
Yellow Swordfish
Member

We are slowly in the process of reorganising the website and this was to be added when that goes public. Sorry about that.

For now you can download it from here

Do make a DB backup before you use it…!

KV kvr28
kvr28
Member

question, is there anyway to disable the all rss? that seems to be creating the query issues, if I use either of my two groups rss feed, there is no issue

MP Mr Papa
Mr Papa
Member

keep in mind that rss stuff doesnt generate any queries on less the link/button is clicked on and the rss feed is displayed…

you can turn off all rss feeds on forum – forums – global rss settings…

additionally you can individually remove forum feeds by editing each forum…

if you want to disable just the all rss feed, simply remove the button from your group view template page of you sp theme…  remember, no queries until its loaded…

KV kvr28
kvr28
Member

I’ve done that, but I have people that had already subscribed to the all rss, so the queries are being generated through whatever feed readers they are using

MP Mr Papa
Mr Papa
Member

well, if you disable the feed, then you mightcause them to get endless errors in the feeds…

but guess you could try something like:

add_filter(‘sph_rss_where’, function() {return ‘0=1’;});

which should basically make the query short circuit and return no results…

YS Yellow Swordfish
Yellow Swordfish
Member

I believe so… try it there first anyway. Meanwhile I am going to work out how that filter of Steve’s works!

KV kvr28
kvr28
Member

it creates this error and kills my staging server

Parse error: syntax error, unexpected ‘=’ in /wp-content/sp-resources/forum-themes/default/templates/spFunctions.php on line 31

KV kvr28
kvr28
Member

what is the difference on how the all rss and the group rss queries? I did a test and moved all forums to the first group and deleted the second group on the staging server, if I use the all rss, long query error still, if I use the group rss no error, but it’s all the exact same feed at this point

YS Yellow Swordfish
Yellow Swordfish
Member

First on the matter of the filter, then if you copied and pasted it then it would be corrupt. Steve didn’t use the syntax highlighter and those quote marks are no good for program code. So if that is the problem then please remove it and type it in manually…

On the query front then I am as as unsure now as the first day you reported this. All the RSS queries are based upon exactly the same query construct with only a change in the WHERE clause.

The ‘long’ part of the query I now understand is an irrelevance as, I assume, that still refers to the length of the query text and I am already on record as having no idea why anyone would monitor that. In fact doing just that lengthens the procedure (in time) as the error log needs to be written out which all takes up valuable time of course.

On the ‘slow’ part then I am truly stumped. As you notice yourself the difference between the ‘All’ and the other RSS queries is simply the WHERE. In fact, I would almost have expected the ‘All’ version to be a little faster on balance.

Afraid I really do not know what else to say. It is a complete mystery…

Anyone else have any odeas or anything to add?

KV kvr28
kvr28
Member

agreed it’s not a error, it’s just a pain in the butt when looking for real errors sifting through the huge wall of text, I thought they were suppose to disable it from showing but it hasn’t happened yet

KV kvr28
kvr28
Member

I got it to work, but it kills the group feeds as well, any way to kill the main while keeping the groups?

MP Mr Papa
Mr Papa
Member

try this:

add_filter('sph_rss_where', 'my_rss_feeds', 10, 2);
function my_rss_feeds($where, $feed) {
    if ($feed == 'all') $where = '0=1';
    return $wwere;
}
MP Mr Papa
Mr Papa
Member

slight typo in the default return value…

add_filter('sph_rss_where', 'my_rss_feeds', 10, 2);
function my_rss_feeds($where, $feed) {
    if ($feed == 'all') $where = '0=1';
    return $where;
}