Welcome to the E-Blah Community!
We would like to welcome you to our community and invite you to register an account or login.
Being a registered member is important, as it gives you several advantages over the normal Guest status. After registering you will be able to download files and images, post messages, and access member-only portions of the forum - just to name a few. Registration is quick and simple, and only takes about a minute of your time.

E-Blah Community    E-Blah Discussion    E-Blah Bugs  ›  General Question
Users Browsing Forum
Googlebot and 1 Guests

General Question  This thread currently has 185 views. Print
1 Pages 1 Recommend Thread
vol7ron
April 17, 2008, 9:38am Report to Moderator Report to Moderator
E-Blah Member
Posts: 102
Gender: Male
Posts Per Day: 0.71
Reputation: 100.00%
Reputation Score: +9 / -0
Time Online: 1 days 22 minutes
Location: Washington DC
Age: 24
Not sure if this is how things are done in the flat file database (Eblah 10.3.5).

In the SQL version when the last post of a thread is deleted, the thread is deleted but the post still remains in the post table.  Was wondering if this was on purpose or a design flaw.

Thanks,
vol7ron



Increase vol7ron's Rating
Logged Offline
Private Message Private message
vol7ron
April 17, 2008, 10:44am Report to Moderator Report to Moderator
E-Blah Member
Posts: 102
Gender: Male
Posts Per Day: 0.71
Reputation: 100.00%
Reputation Score: +9 / -0
Time Online: 1 days 22 minutes
Location: Washington DC
Age: 24
Didn't know if you wanted to change the program or provide a clean up utility, but this will delete all the occasions

Code
DELETE FROM ${main::forumprefix}POSTS 
WHERE ID IN(
   select id from ${main::forumprefix}posts 
   where not exists (
      select * from ${main::forumprefix}topics 
      where ${main::forumprefix}posts.threadid = ${main::forumprefix}topics.id
   )
);


There may or may not be a more efficient query to do the same thing.  But it pretty much goes through and deletes all the posts that don't have a thread anymore.

Because the forecasted threads that get deleted with remaining posts is probably gonna be a small number, you'd probably wanna save processing power for the users and just perform this as a utility cleanup maybe once a month.  Otherwise, if it happened often, you'd wanna build this into the forum to prevent table bloat, which would increase the seek time.



Increase vol7ron's Rating
Logged Offline
Private Message Private message Reply: 1 - 1
1 Pages 1 Recommend Thread
Print

E-Blah Community    E-Blah Discussion    E-Blah Bugs  ›  General Question