Hoeveel MB schrijfruimte voor een goed lopend forum

Voor discussies rondom phpBB2. phpBB2 wordt niet meer ondersteund en deze berichten kunnen wellicht gedateerd zijn.
Forumregels

Sinds 1 januari 2009 wordt phpBB2 niet meer ondersteund.
Onderstaande informatie is verouderd en dient uitsluitend als archief.
phpBB2.0.x
wizzzzzzzz
Berichten: 661
Lid geworden op: 05 feb 2005, 14:26
Locatie: Op zolder
Contacteer:

Bericht door wizzzzzzzz » 01 feb 2006, 20:43

Carina schreef:Wij schrijven echt heel veel. En we hebben lezers.
Maar wacht effe: Ik was het vergeten, maar we hebben de database niet over gezet, want er was een grote storing op messageboard (eind december) waar we eerst zaten en we hadden geen zin om te wachten.
We hebben wel veel berichten zo overgezet.
We hebben wel een album van smartor maar daar zitten niet zo gek veel foto's in.
Als het zo doorgaat moeten we over tijd, iets van pruning instellen of zo. We hebben 500 MB dacht ik, aan ruimte dus voorlopig zitten we nog goed.
Het gaat wel hard en elke dag zie je het groeien. (ik back bijna elke dag op)

Dit zijn mijn stats en toch maar 18.2 mb

Code: Selecteer alles

Aantal berichten 29461 Berichten
Aantal onderwerpen 740 
Aantal gebruikers 130 
Database formaat 18.17 MB 

Carina
Berichten: 103
Lid geworden op: 24 apr 2005, 17:40
Contacteer:

Bericht door Carina » 01 feb 2006, 20:49

Dit zijn de onze.
We hebben wel op sommige dagen veel lezers van weer een ander forum. Of misschien toch het album ook. Ik weet het niet.

Code: Selecteer alles

We hebben 33 geregistreerde gebruikers
De gebruikers hebben in totaal 11897 berichten geplaatst within 546 topics

Gebruikersavatar
Bee
Berichten: 13403
Lid geworden op: 29 aug 2004, 10:30

Bericht door Bee » 01 feb 2006, 20:51

Het komt door de zoektabellen, 50000 posts meer hoeft niet zo'n gek grote groei te zijn voor de database, maar omdat voor elke posts ook allerlei zoekwoorden worden opgeslagen, groeit de database sneller dan (ik persoonlijk) nodig vind. Je kan bijvoorbeeld een FULLTEXT search mod in bouwen (getest door BartVB persoonlijk)
... Maar ik modereer (nog) niet.

Carina
Berichten: 103
Lid geworden op: 24 apr 2005, 17:40
Contacteer:

Bericht door Carina » 01 feb 2006, 20:55

Bee schreef:Het komt door de zoektabellen, 50000 posts meer hoeft niet zo'n gek grote groei te zijn voor de database, maar omdat voor elke posts ook allerlei zoekwoorden worden opgeslagen, groeit de database sneller dan (ik persoonlijk) nodig vind. Je kan bijvoorbeeld een FULLTEXT search mod in bouwen (getest door BartVB persoonlijk)
Dank je!
Ik zal eens gaan kijken naar die mod! Ja die database is heeeeeel veel zoektekst.

Gebruikersavatar
Bee
Berichten: 13403
Lid geworden op: 29 aug 2004, 10:30

Bericht door Bee » 01 feb 2006, 20:58

Hoi Carina,

Deze zoek je:

Code: Selecteer alles

################################################################# 
## Mod Title: Full-Text Index searching (in progress) 
## Mod Version: 0.1.0 ALPHA 
## Author: Benjamin Ellington < ben@cyberjag.com > - http://www.gamejag.com 
## 
## Description: Replaces phpBB's search methods with one that supports full-text indices 
## 
## Installation Level: advanced 
## Installation Time: 30-60 Minutes, plus re-indexing time 
## Files To Edit: 
## 
##   \modcp.php 
##   \search.php 
##   \includes\constants.php 
##   \includes\functions_search.php 
##   \includes\functions_post.php 
##   \includes\prune.php 
## 
################################################################# 
## Before Adding This MOD To Your Forum, You Should Back Up All Files 
## Related To This MOD and your database.  
################################################################# 
## 
## Installation instructions: 
## 
## 1 - One significant SQL database change is required, and two are optional. Open 
##      PhpMyAdmin or another SQL command prompt and execute the provided instructions. 
##      Make sure the phpbb_ is replaced with your database name if different. 
## 
## 2 - If you have already installed other mods that affect the same fIles, you need 
##      to take care with the changes made.  Make sure you don't disable them in the 
##      process of installing this one. 
## 
## 3 - Because of the initial requirements in creating the index, I highly 
##     recommend you create the new indexes first, and once they are successfully 
##     created then proceed with the rest of the MOD.  Large boards can take several 
##     hours to index. 
## 
################################################################# 
## 
## Revision history since 0.9.3 
## 
## 0.1.0  Alpha version released 
## 
################################################################# 
# 
#-----[ SQL ]------------------------------------------ 
# 

ALTER TABLE phpbb_posts_text ADD FULLTEXT (post_subject,post_text); 

#  (This will take FOREVER!  Also, this is marked for change as it's not the best 
#  way to do it.  You should make separate indices for the text field and the subject 
#  field and rewrite the search function accordingly.) 


# 
#-----[ OPEN ]------------------------------------------ 
# 

     modcp.php 

# 
#-----[ FIND NEAR LINE 337 ]------------------------------------------ 
# 

     remove_search_post($post_id_sql); 

# 
#-----[ DELETE OR COMMENT OUT ]------------------------------------------ 
# 

     remove_search_post($post_id_sql); 

# 
#-----[ OPEN ]------------------------------------------ 
# 

     search.php 

# 
#-----[ FIND NEAR LINE 253 ]------------------------------------------ 
# 

     $search_msg_only = ( !$search_fields ) ? "AND m.title_match = 0" : ( ( strstr($multibyte_charset, $lang['ENCODING']) ) ? '' : '' ); 

# 
#-----[ DELETE OR COMMENT OUT ]------------------------------------------ 
# 

     $search_msg_only = ( !$search_fields ) ? "AND m.title_match = 0" : ( ( strstr($multibyte_charset, $lang['ENCODING']) ) ? '' : '' ); 

# 
#-----[ FIND NEAR LINE 283 ]------------------------------------------ 
# 

     if ( !strstr($multibyte_charset, $lang['ENCODING']) ) 
     { 
       $match_word = str_replace('*', '%', $split_search[$i]); 
       $sql = "SELECT m.post_id 
       FROM " . SEARCH_WORD_TABLE . " w, " . SEARCH_MATCH_TABLE . " m 
       WHERE w.word_text LIKE '$match_word' 
         AND m.word_id = w.word_id 
         AND w.word_common <> 1 
         $search_msg_only"; 
     } 

# 
#-----[ CHANGE TO ]------------------------------------------ 
# 

     if ( !strstr($multibyte_charset, $lang['ENCODING']) ) 
     { 
       $match_word = str_replace('*', '%', $split_search[$i]); 
//       if (!$search_fields) 
//       { 
//         $sql = "SELECT post_id 
//         FROM " . POSTS_TEXT_TABLE . " 
//         WHERE MATCH (post_text) AGAINST ('$match_word')"; 
//       } 
//       else 
//       { 
           $sql = "SELECT post_id 
           FROM " . POSTS_TEXT_TABLE . " 
           WHERE MATCH (post_subject,post_text) AGAINST ('$match_word')"; 
//      } 

#  (Notice the commented out lines.  That's because I indexed two fields together 
#  instead of making two different indexes--see the initial SQL statement in this mod) 

# 
#-----[ OPEN ]------------------------------------------ 
# 

     includes/constants.php 

# 
#-----[ FIND NEAR LINE 166 ]------------------------------------------ 
# 

     define('SEARCH_WORD_TABLE', $table_prefix.'search_wordlist'); 
     define('SEARCH_MATCH_TABLE', $table_prefix.'search_wordmatch'); 

# 
#-----[ DELETE OR COMMENT OUT ]------------------------------------------ 
# 

     define('SEARCH_WORD_TABLE', $table_prefix.'search_wordlist'); 
     define('SEARCH_MATCH_TABLE', $table_prefix.'search_wordmatch'); 

# 
#-----[ OPEN ]------------------------------------------ 
# 

     includes/functions_post.php 

# 
#-----[ FIND NEAR LINE 285 ]------------------------------------------ 
# 


     add_search_words('single', $post_id, stripslashes($post_message), stripslashes($post_subject)); 

# 
#-----[ DELETE OR COMMENT OUT ]------------------------------------------ 
# 

     add_search_words('single', $post_id, stripslashes($post_message), stripslashes($post_subject)); 

# 
#-----[ FIND NEAR LINE 246 ]------------------------------------------ 
# 

     if ($mode == 'editpost') 
     { 
       remove_search_post($post_id); 
     } 

# 
#-----[ DELETE OR COMMENT OUT ]------------------------------------------ 
# 

     if ($mode == 'editpost') 
     { 
       remove_search_post($post_id); 
     } 

# 
#-----[ FIND NEAR LINE 528 ]------------------------------------------ 
# 

     remove_search_post($post_id); 

# 
#-----[ DELETE OR COMMENT OUT ]------------------------------------------ 
# 
          
     remove_search_post($post_id); 

# 
#-----[ OPEN ]------------------------------------------ 
# 

     includes/functions_search.php 

# 
#-----[ FIND NEAR LINE 105 ]------------------------------------------ 
# 

     function add_search_words($mode, $post_id, $post_text, $post_title = '') 

# 
#-----[ DELETE OR COMMENT OUT ]------------------------------------------ 
# 

     function add_search_words($mode, $post_id, $post_text, $post_title = '') 
     { 
        global $db, $phpbb_root_path, $board_config, $lang; 

        $stopword_array = @file($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . "/search_stopwords.txt"); 
        $synonym_array = @file($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . "/search_synonyms.txt"); 

        $search_raw_words = array(); 
        $search_raw_words['text'] = split_words(clean_words('post', $post_text, $stopword_array, $synonym_array)); 
        $search_raw_words['title'] = split_words(clean_words('post', $post_title, $stopword_array, $synonym_array)); 

        @set_time_limit(0); 

        $word = array(); 
        $word_insert_sql = array(); 
        while ( list($word_in, $search_matches) = @each($search_raw_words) ) 
        { 
           $word_insert_sql[$word_in] = ''; 
           if ( !empty($search_matches) ) 
           { 
              for ($i = 0; $i < count($search_matches); $i++) 
              { 
                 $search_matches[$i] = trim($search_matches[$i]); 

                 if( $search_matches[$i] != '' ) 
                 { 
                    $word[] = $search_matches[$i]; 
                    if ( !strstr($word_insert_sql[$word_in], "'" . $search_matches[$i] . "'") ) 
                    { 
                       $word_insert_sql[$word_in] .= ( $word_insert_sql[$word_in] != "" ) ? ", '" . $search_matches[$i] . "'" : "'" . $search_matches[$i] . "'"; 
                    } 
                 } 
              } 
           } 
        } 

        if ( count($word) ) 
        { 
           sort($word); 

           $prev_word = ''; 
           $word_text_sql = ''; 
           $temp_word = array(); 
           for($i = 0; $i < count($word); $i++) 
           { 
              if ( $word[$i] != $prev_word ) 
              { 
                 $temp_word[] = $word[$i]; 
                 $word_text_sql .= ( ( $word_text_sql != '' ) ? ', ' : '' ) . "'" . $word[$i] . "'"; 
              } 
              $prev_word = $word[$i]; 
           } 
           $word = $temp_word; 

           $check_words = array(); 
           switch( SQL_LAYER ) 
           { 
              case 'postgresql': 
              case 'msaccess': 
              case 'mssql-odbc': 
              case 'oracle': 
              case 'db2': 
                 $sql = "SELECT word_id, word_text      
                    FROM " . SEARCH_WORD_TABLE . " 
                    WHERE word_text IN ($word_text_sql)"; 
                 if ( !($result = $db->sql_query($sql)) ) 
                 { 
                    message_die(GENERAL_ERROR, 'Could not select words', '', __LINE__, __FILE__, $sql); 
                 } 

                 while ( $row = $db->sql_fetchrow($result) ) 
                 { 
                    $check_words[$row['word_text']] = $row['word_id']; 
                 } 
                 break; 
           } 

           $value_sql = ''; 
           $match_word = array(); 
           for ($i = 0; $i < count($word); $i++) 
           { 
              $new_match = true; 
              if ( isset($check_words[$word[$i]]) ) 
              { 
                 $new_match = false; 
              } 

              if ( $new_match ) 
              { 
                 switch( SQL_LAYER ) 
                 { 
                    case 'mysql': 
                    case 'mysql4': 
                       $value_sql .= ( ( $value_sql != '' ) ? ', ' : '' ) . '(\'' . $word[$i] . '\', 0)'; 
                       break; 
                    case 'mssql': 
                       $value_sql .= ( ( $value_sql != '' ) ? ' UNION ALL ' : '' ) . "SELECT '" . $word[$i] . "', 0"; 
                       break; 
                    default: 
                       $sql = "INSERT INTO " . SEARCH_WORD_TABLE . " (word_text, word_common) 
                          VALUES ('" . $word[$i] . "', 0)"; 
                       if( !$db->sql_query($sql) ) 
                       { 
                          message_die(GENERAL_ERROR, 'Could not insert new word', '', __LINE__, __FILE__, $sql); 
                       } 
                       break; 
                 } 
              } 
           } 

           if ( $value_sql != '' ) 
           { 
              switch ( SQL_LAYER ) 
              { 
                 case 'mysql': 
                 case 'mysql4': 
                    $sql = "INSERT IGNORE INTO " . SEARCH_WORD_TABLE . " (word_text, word_common) 
                       VALUES $value_sql"; 
                    break; 
                 case 'mssql': 
                    $sql = "INSERT INTO " . SEARCH_WORD_TABLE . " (word_text, word_common) 
                       $value_sql"; 
                    break; 
              } 

              if ( !$db->sql_query($sql) ) 
              { 
                 message_die(GENERAL_ERROR, 'Could not insert new word', '', __LINE__, __FILE__, $sql); 
              } 
           } 
        } 

        while( list($word_in, $match_sql) = @each($word_insert_sql) ) 
        { 
           $title_match = ( $word_in == 'title' ) ? 1 : 0; 

           if ( $match_sql != '' ) 
           { 
              $sql = "INSERT IGNORE INTO " . SEARCH_MATCH_TABLE . " (post_id, word_id, title_match) 
                 SELECT $post_id, word_id, $title_match  
                    FROM " . SEARCH_WORD_TABLE . " 
                    WHERE word_text IN ($match_sql)"; 
              if ( !$db->sql_query($sql) ) 
              { 
                 message_die(GENERAL_ERROR, 'Could not insert new word matches', '', __LINE__, __FILE__, $sql); 
              } 
           } 
        } 

        if ($mode == 'single') 
        { 
           remove_common('single', 4/10, $word); 
        } 

        return; 
     } 

# 
#-----[ FIND NEAR LINE 265 ]------------------------------------------ 
# 

     function remove_common($mode, $fraction, $word_id_list = array()) 

# 
#-----[ DELETE OR COMMENT OUT ]------------------------------------------ 
# 

     function remove_common($mode, $fraction, $word_id_list = array()) 
     { 
        global $db; 

        $sql = "SELECT COUNT(post_id) AS total_posts 
           FROM " . POSTS_TABLE; 
        if ( !($result = $db->sql_query($sql)) ) 
        { 
           message_die(GENERAL_ERROR, 'Could not obtain post count', '', __LINE__, __FILE__, $sql); 
        } 

        $row = $db->sql_fetchrow($result); 

        if ( $row['total_posts'] >= 100 ) 
        { 
           $common_threshold = floor($row['total_posts'] * $fraction); 

           if ( $mode == 'single' && count($word_id_list) ) 
           { 
              $word_id_sql = ''; 
              for($i = 0; $i < count($word_id_list); $i++) 
              { 
                 $word_id_sql .= ( ( $word_id_sql != '' ) ? ', ' : '' ) . "'" . $word_id_list[$i] . "'"; 
              } 

              $sql = "SELECT m.word_id 
                 FROM " . SEARCH_MATCH_TABLE . " m, " . SEARCH_WORD_TABLE . " w 
                 WHERE w.word_text IN ($word_id_sql)  
                    AND m.word_id = w.word_id 
                 GROUP BY m.word_id 
                 HAVING COUNT(m.word_id) > $common_threshold"; 
           } 
           else 
           { 
              $sql = "SELECT word_id 
                 FROM " . SEARCH_MATCH_TABLE . " 
                 GROUP BY word_id 
                 HAVING COUNT(word_id) > $common_threshold"; 
           } 

           if ( !($result = $db->sql_query($sql)) ) 
           { 
              message_die(GENERAL_ERROR, 'Could not obtain common word list', '', __LINE__, __FILE__, $sql); 
           } 

           $common_word_id = ''; 
           while ( $row = $db->sql_fetchrow($result) ) 
           { 
              $common_word_id .= ( ( $common_word_id != '' ) ? ', ' : '' ) . $row['word_id']; 
           } 
           $db->sql_freeresult($result); 

           if ( $common_word_id != '' ) 
           { 
              $sql = "UPDATE " . SEARCH_WORD_TABLE . " 
                 SET word_common = " . TRUE . " 
                 WHERE word_id IN ($common_word_id)"; 
              if ( !$db->sql_query($sql) ) 
              { 
                 message_die(GENERAL_ERROR, 'Could not delete word list entry', '', __LINE__, __FILE__, $sql); 
              } 

              $sql = "DELETE FROM " . SEARCH_MATCH_TABLE . "  
                 WHERE word_id IN ($common_word_id)"; 
              if ( !$db->sql_query($sql) ) 
              { 
                 message_die(GENERAL_ERROR, 'Could not delete word match entry', '', __LINE__, __FILE__, $sql); 
              } 
           } 
        } 

        return; 
     } 

# 
#-----[ FIND NEAR LINE 339 ]------------------------------------------ 
# 

     function remove_search_post($post_id_sql) 

# 
#-----[ DELETE OR COMMENT OUT ]------------------------------------------ 
# 

     function remove_search_post($post_id_sql) 
     { 
        global $db; 

        $words_removed = false; 

        switch ( SQL_LAYER ) 
        { 
           case 'mysql': 
           case 'mysql4': 
              $sql = "SELECT word_id 
                 FROM " . SEARCH_MATCH_TABLE . " 
                 WHERE post_id IN ($post_id_sql) 
                 GROUP BY word_id"; 
              if ( $result = $db->sql_query($sql) ) 
              { 
                 $word_id_sql = ''; 
                 while ( $row = $db->sql_fetchrow($result) ) 
                 { 
                    $word_id_sql .= ( $word_id_sql != '' ) ? ', ' . $row['word_id'] : $row['word_id']; 
                 } 

                 $sql = "SELECT word_id 
                    FROM " . SEARCH_MATCH_TABLE . " 
                    WHERE word_id IN ($word_id_sql) 
                    GROUP BY word_id 
                    HAVING COUNT(word_id) = 1"; 
                 if ( $result = $db->sql_query($sql) ) 
                 { 
                    $word_id_sql = ''; 
                    while ( $row = $db->sql_fetchrow($result) ) 
                    { 
                       $word_id_sql .= ( $word_id_sql != '' ) ? ', ' . $row['word_id'] : $row['word_id']; 
                    } 

                    if ( $word_id_sql != '' ) 
                    { 
                       $sql = "DELETE FROM " . SEARCH_WORD_TABLE . " 
                          WHERE word_id IN ($word_id_sql)"; 
                       if ( !$db->sql_query($sql) ) 
                       { 
                          message_die(GENERAL_ERROR, 'Could not delete word list entry', '', __LINE__, __FILE__, $sql); 
                       } 

                       $words_removed = $db->sql_affectedrows(); 
                    } 
                 } 
              } 
              break; 

           default: 
              $sql = "DELETE FROM " . SEARCH_WORD_TABLE . " 
                 WHERE word_id IN ( 
                    SELECT word_id 
                    FROM " . SEARCH_MATCH_TABLE . " 
                    WHERE word_id IN ( 
                       SELECT word_id 
                       FROM " . SEARCH_MATCH_TABLE . " 
                       WHERE post_id IN ($post_id_sql) 
                       GROUP BY word_id 
                    ) 
                    GROUP BY word_id 
                    HAVING COUNT(word_id) = 1 
                 )"; 
              if ( !$db->sql_query($sql) ) 
              { 
                 message_die(GENERAL_ERROR, 'Could not delete old words from word table', '', __LINE__, __FILE__, $sql); 
              } 

              $words_removed = $db->sql_affectedrows(); 

              break; 
        } 

        $sql = "DELETE FROM " . SEARCH_MATCH_TABLE . "  
           WHERE post_id IN ($post_id_sql)"; 
        if ( !$db->sql_query($sql) ) 
        { 
           message_die(GENERAL_ERROR, 'Error in deleting post', '', __LINE__, __FILE__, $sql); 
        } 

        return $words_removed; 
     } 


# 
#-----[ OPEN ]------------------------------------------ 
# 

     includes/prune.php 

# 
#-----[ FIND NEAR LINE 111 ]------------------------------------------ 
# 

     $sql = "DELETE FROM " . SEARCH_MATCH_TABLE . " 

# 
#-----[ DELETE OR COMMENT OUT (May not exist in newer installations) ]------------------------------------------ 
# 

     $sql = "DELETE FROM " . SEARCH_MATCH_TABLE . " 
       WHERE post_id IN ($sql_post)"; 
     if ( !$db->sql_query($sql) ) 
     { 
       message_die(GENERAL_ERROR, 'Could not delete search matches', '', __LINE__, __FILE__, $sql); 
     } 

# 
#-----[ FIND NEAR LINE 113 ]------------------------------------------ 
# 

     remove_search_post($sql_post); 

# 
#-----[ DELETE OR COMMENT OUT ]------------------------------------------ 
# 

     remove_search_post($sql_post); 

# 
#-----[ SQL ]------------------------------------------ 
# 

DROP TABLE phpbb_posts_search_wordtext; 
DROP TABLE phpbb_posts_search_wordmatch; 

# 
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------ 
# 
# EoM
Ook te vinden op http://www.phpbb.com/phpBB/viewtopic.ph ... t=fulltext
... Maar ik modereer (nog) niet.

Gesloten