I did a check for "orphan" polls, polls that are not linked to any post, and found myself a few.

If you have MySQL >= 4.1 you might want to have a look if you can clean up a little too:

Code
SELECT POLL_BODY
FROM ubbt_POLL_DATA
WHERE POST_ID NOT
IN (
SELECT POST_ID
FROM ubbt_POSTS
)

This will show the poll questions of orphaned polls.

Code
delete from ubbt_POLL_DATA where POST_ID not in (select POST_ID from ubbt_POSTS);
delete from ubbt_POLL_OPTIONS where POLL_ID not in (select POLL_ID from ubbt_POLL_DATA);
delete from ubbt_POLL_VOTES where POLL_ID not in (select POLL_ID from ubbt_POLL_DATA);

These 3 do the actual cleanup (polls, poll options and the votes). Change the ubbt_ prefix if you happen to have another one in use.


[Linked Image from siemons.org]