Andreas
06-29-2004, 09:44 PM
It seems like displaying results of public posts on my board is damn slow.
Looking at the queries I found that for each option there is one query, which takes kinde long to execute.
Example:
SELECT user.userid,user.username
FROM pollvote AS pollvote, user AS user
WHERE user.userid = pollvote.userid AND
pollid = '1832' AND
voteoption = '1'
ORDER BY username ASC
Time before: 0.42810201644897
Memory Before: 698KB
Time after: 0.87274694442749
Time taken: 0.44464492797852
Memory After: 698KB
Now let's say there are 10 options. Together with the time for the other queries and PHP processing this accumulates to 5+ seconds to generate the page!
Any idea as to why these queries are that slow and how this could be optimized (vB3)?
Looking at the queries I found that for each option there is one query, which takes kinde long to execute.
Example:
SELECT user.userid,user.username
FROM pollvote AS pollvote, user AS user
WHERE user.userid = pollvote.userid AND
pollid = '1832' AND
voteoption = '1'
ORDER BY username ASC
Time before: 0.42810201644897
Memory Before: 698KB
Time after: 0.87274694442749
Time taken: 0.44464492797852
Memory After: 698KB
Now let's say there are 10 options. Together with the time for the other queries and PHP processing this accumulates to 5+ seconds to generate the page!
Any idea as to why these queries are that slow and how this could be optimized (vB3)?