Welcome Guest, Not a member yet? Register   Sign In
ci_sessions table is getting big - like 6M records and 90meg big
#1

(This post was last modified: 07-02-2018, 05:07 PM by zurtri.)

ci_sessions table is getting big - like 6M records and 90meg big

Is there any problem with me just truncating the table?

These are my settings in config

PHP Code:
$config['sess_driver'] = 'database';
$config['sess_cookie_name'] = 'ci_session';
$config['sess_expiration'] = 7200;
$config['sess_save_path'] = 'ci_sessions';
$config['sess_match_ip'] = FALSE;
$config['sess_time_to_update'] = 300;
$config['sess_regenerate_destroy'] = FALSE

I also note that my table did not have the primary key set:

PHP Code:
// When sess_match_ip = FALSE
ALTER TABLE ci_sessions ADD PRIMARY KEY (id); 

So my plan is to truncate the table (knock it to 0 records) and then add the primary key.

Buuuuut - this is a production DB so I want to get the advice of the learned folks here before I commit such an act.

Also why would my sessions in ci_sessions not be being cleaned up by the garbage collector?
Reply


Messages In This Thread
ci_sessions table is getting big - like 6M records and 90meg big - by zurtri - 07-02-2018, 04:58 PM



Theme © iAndrew 2016 - Forum software by © MyBB