Log in

View Full Version : Admin CP - Who Voted taking forever?


Tigga
04-24-2003, 08:49 PM
Just wondering if I'm the only one that's experienced this problem... Before, whenever I would click on the "Who Voted?" link in the Admin CP to see who voted on a poll, it would take forever for the page to load that allows you to select which poll (168 seconds when I checked it). I figured out a simple fix for it, so I was wondering if anyone else experienced this problem or if it was just me... And wondering if it was worth releasing.

Boofo
04-24-2003, 09:38 PM
I just checked mine and it came up instantly. But I don't have a very active forum and there aren't many threads or posts. I'd be curious to see what you did to fix it, though. ;)

filburt1
04-24-2003, 09:59 PM
I think I've noticed this before and is the result of just getting the many poll threads and putting them in the combobox.

Tigga
04-24-2003, 10:36 PM
Yea, that's exactly what it's coming from... It seems though if you reverse the query (pull from the thread and left join the poll) it works much better. Here's what I changed if anyone would like to try it out...
In admin/thread.php find:
$polls = $DB_site->query("
SELECT poll.pollid, poll.question, thread.title
FROM poll
LEFT JOIN thread USING(pollid)
ORDER BY thread.dateline DESC
");
Replace that with:
$polls = $DB_site->query("
SELECT thread.title, poll.pollid, poll.question
FROM thread
LEFT JOIN poll ON (thread.pollid=poll.pollid)
WHERE thread.open<>10 AND thread.pollid!='0'
ORDER BY thread.dateline DESC
");
Just that simple change seemed to do the trick. When I checked the time it took to load the page before hand it was 168 seconds. Afterwards it was pretty much instant. If anyone else has noticed that problem and the fix helps them as well please let me know and I'll go ahead and release it. :)

filburt1
04-24-2003, 10:56 PM
You might want to post in the vB2 Troubleshooting forums and post it as a bug so it can be fixed in the inevidable 2.3.1 (because IMO a 138-sec page is a bug).

Boofo
04-25-2003, 09:17 AM
Yesterday at 05:36 PM Tigga said this in Post #4 (https://vborg.vbsupport.ru/showthread.php?postid=386666#post386666)
Yea, that's exactly what it's coming from... It seems though if you reverse the query (pull from the thread and left join the poll) it works much better. Here's what I changed if anyone would like to try it out...
In admin/thread.php find:
$polls = $DB_site->query("
SELECT poll.pollid, poll.question, thread.title
FROM poll
LEFT JOIN thread USING(pollid)
ORDER BY thread.dateline DESC
");
Replace that with:
$polls = $DB_site->query("
SELECT thread.title, poll.pollid, poll.question
FROM thread
LEFT JOIN poll ON (thread.pollid=poll.pollid)
WHERE thread.open<>10 AND thread.pollid!='0'
ORDER BY thread.dateline DESC
");
Just that simple change seemed to do the trick. When I checked the time it took to load the page before hand it was 168 seconds. Afterwards it was pretty much instant. If anyone else has noticed that problem and the fix helps them as well please let me know and I'll go ahead and release it. :)

Will this also list polls in threads that are closed?

Tigga
04-25-2003, 06:03 PM
Bofo - Yes, the "thread.open<>10" code there is just telling it not to pull a "redirect" thread, or one that has the "moved:" prefix in front of it. That code should do the exact same thing as the original code, only much faster if you're experiencing problems with the page load time. :)

Filbert - I've actually posted 3 things (including this one) there over the last week or two, but haven't seen any replies yet. I'm starting to wonder if the devs are even concerned about small bugs in v2.x, or if they're just trying to avoid releasing another version besides 3.0. :ermm:

Boofo
04-25-2003, 10:22 PM
So, that's what the "thread.open<>10" means. I have always wondered about that. Thanks for explaining it to me. ;)

What other small bugs have you posted about?

filburt1
04-25-2003, 10:23 PM
They should still fix bugs in the 2.x.x series considering that's the one that they're selling to consumers.

gorman
08-21-2003, 04:30 PM
04-25-03 at 12:36 AM Tigga said this in Post #4 (https://vborg.vbsupport.ru/showthread.php?postid=386666#post386666)
Yea, that's exactly what it's coming from... It seems though if you reverse the query (pull from the thread and left join the poll) it works much better. Here's what I changed if anyone would like to try it out...
Tigga, can't believe this was so easy... don't know if they have fixed it in following releases, I'm using 2.2.8 with some security modifications... Thanks a lot! :)