After some use of Trac the we encountered slowness of the system.
Lately I noticed it happens when someone tries to access the user list,
but only now did I check the database:

sqlite> select count(*) from session_attribute;
781194
sqlite> select count(*) from session_attribute where authenticated <> 1;
774670
sqlite> select count(*) from session_attribute where authenticated = 1;
6538

sqlite> select count(*) from session;
300174
sqlite> select count(*) from session where authenticated <> 1;
298771
sqlite> select count(*) from session where authenticated = 1;
1403

In other words, about 99-99.5% of the sessions tables are used for information
about people who are not authenticated users.

My solution: clean up the session tables, remove not-so-important entries:
delete from session_attribute where authenticated <> 1;
delete from session where authenticated <> 1;

And now the user list loads fast again.

BTW here are the schemas of the the two tables:


sqlite> .schema session
CREATE TABLE session (
    sid text,
    authenticated integer,
    last_visit integer,
    UNIQUE (sid,authenticated)
);
CREATE INDEX session_authenticated_idx ON session (authenticated);
CREATE INDEX session_last_visit_idx ON session (last_visit);
sqlite> .schema session_attribute
CREATE TABLE session_attribute (
    sid text,
    authenticated integer,
    name text,
    value text,
    UNIQUE (sid,authenticated,name)
);


Gabor
_______________________________________________
Padre-dev mailing list
Padre-dev@perlide.org
http://mail.perlide.org/mailman/listinfo/padre-dev

Reply via email to