News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Deleting records from SMF_Log

Started by NoobDeveloper, December 19, 2009, 05:23:36 AM

Previous topic - Next topic

NoobDeveloper

Hi
I would like to know what will happen if i delete records from below table.

Kindly post what exactly each table is used for.

1. smf_log_boards  13,900 rows
2. smf_log_mark_read 400 rows
3. smf_log_search_subjects 4000 rows
4. smf_log_topics 83,746 rows.

suppose i delete all rows form above mentioned rows will it cause any issues for SMF forum ?

Arantor

1. Users will think the boards they have seen have new items in
2. Users will find any boards they have marked as read will not be read
3. Searching may be broken
4. Topics will get marked unread
Holder of controversial views, all of which my own.


NoobDeveloper

few doubts again

Quote1. smf_log_boards  13,900 rows
1. Users will think the boards they have seen have new items in
You mean all topics for them will be marked as NEW ?

Quote2. smf_log_mark_read 400 rows
2. Users will find any boards they have marked as read will not be read
Sorry. Not able to understand what will happen. Can you explain in details.

Quote3. smf_log_search_subjects 4000 rows
3. Searching may be broken
Mine is a regional forum and not using English language. And no one will ever use SEARCH functionality. So i think if i delete all records SMF functioning wont be affected. Am i right ?

Quote4. smf_log_topics 83,746 rows.
4. Topics will get marked unread
Does this means that for All members, All topics will be marked as NEW ?



Arantor

1. log_boards is the log of when the user physically reads the message index page, and is used to figure out on the board index whether to show the board as all read or not. Best to leave alone.

2. log_mark_read is for when users use the 'Mark as Read' button. Users have marked boards read, this will make the board look unread on the board index. Best to leave alone.

3. Language is irrelevant. When you create topics, the search function still builds a list of the subjects for searching later. If you ever want to use search (and generally it's a good thing) leave it alone. It will only get rebuilt anyway over time.

4. It will mark every single topic as new if you empty it. Best to leave alone.
Holder of controversial views, all of which my own.


NoobDeveloper

Nice explanation and thanks for efforts taken to type this.

What i want to do is Mark all topics are read for all users.  which query i need to fire from back-end ?

Arantor

To do that, add one new row per topic per user...

To work out how many rows you'll add, multiply the number of topics by the number of users and subtract how many rows are in log_topics already.
Holder of controversial views, all of which my own.


NoobDeveloper

Quote from: The Grinch on December 19, 2009, 06:43:46 AM
To do that, add one new row per topic per user...

To work out how many rows you'll add, multiply the number of topics by the number of users and subtract how many rows are in log_topics already.

Sorry dear..did not got it clear. 
Can  i use this ?
http://www.simplemachines.org/community/index.php?topic=212330.msg1667071#msg1667071

the attachment 1.1.x_inactiveusers_markallboardsread.php


what i want is to mark all topics as read for all users as mentioned in SMF Optimization tips thread.
http://www.simplemachines.org/community/index.php?topic=293441.0

Arantor

That script works by removing log_topics and filling log_mark_read. From what you were saying you were talking about marking everything read for everyone, which fills up log_topics normally.

So you don't want to just remove records. You want to remove some and add others. The script posted by karlbenson should work as intended, but with the number of rows you have currently I'm really not sure it's worth it unless you are on shared hosting.
Holder of controversial views, all of which my own.


NoobDeveloper


Arantor

It still won't make a *huge* difference in performance. You'll get better performance out of some of the other steps first.
Holder of controversial views, all of which my own.


NoobDeveloper

Thanks dear. I have already done that.

Thanks again for helping me.

Good Day.

Advertisement: