Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+1 vote
1.2k views
in Q2A Core by

I am still having issues with the database size. Having a daily backup running gives me huge files on my server.

1. Running on 1.5.4 mod I have 260 MB for qa_blobs ← this will be reduced to 0 after I upgrade and mirgrate all images from blob to harddrive ✓

2. I still see qa_contentwords getting bigger and bigger. Today I emptied it to save up to 200 MB. As far as my investigation goes this table is only used for the internal search. I changed the search to Google Custom search engine, so I don't need it anymore.

3. Also qa_words is not needed using the other search engine, as far as I know.

Instead of manually emptying both tables, I would like to prevent q2a writing to them.

** Note: I cannot truncate qa_words, instead I get the mysql error message:

#1701 - Cannot truncate a table referenced in a foreign key constraint (`db123`.`qa_contentwords`, CONSTRAINT `qa_contentwords_ibfk_2` FOREIGN KEY (`wordid`) REFERENCES `db123`.`qa_words` (`wordid`))

**

Me and others once tried to find out which tables are not needed, but without a clear solution.

@gidgreen: It would be nice if you implement an option that qa_contentwords and qa_words and other tables related to the q2a search can be "switched off".

Thanks,
Kai

 

PS: From q2a security section the tables not need (? really all) seem to be: qa_cache, qa_contentwords, qa_iplimits, qa_posttags, qa_sharedevents, qa_tagwords, qa_titlewords, qa_userevents, qa_userlimits, qa_words

Q2A version: 1.5.4

1 Answer

+2 votes
by
selected by
 
Best answer

If you comment out this line in qa-base.php, the search-related tables will no longer be populated:

qa_register_module('search', 'qa-search-basic.php', 'qa_search_basic', '');

by
Thanks a lot, that is the answer I was hoping for =)
by
edited by
Okay, there seems to be one drawback: The related questions widget is not working anymore. So the "search" module is not only for the q2a search but also for the related questions.

Is there any possibility to keep them alive but switch off the search? ... Examining function qa_db_related_qs_selectspec() I see that ^titlewords are only used for related questions?! So switching off the search module switches of this function?
by
edited by
I guess I have to keep the search module activated but comment out in qa-search-basic.php: $contentwordidcounts=array(); ... ... ...

Maybe also commenting out: qa_db_word_contentcount_update(array_keys($contentwordidcounts));

I tried and it works. Could there be any other dependency problems?
Thanks, Kai
by
Good, I disabled the above and qa_contentwords is not filled anymore, and the related questions are working. Nice one!
...