Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
documentation:2.1:browseablesessionbackend [2019/06/11 18:44]
xguimard
documentation:2.1:browseablesessionbackend [2019/11/07 14:36]
maxbes [Presentation]
Line 12: Line 12:
 ^  Feature ​ ^  Fields to index  ^ ^  Feature ​ ^  Fields to index  ^
 | Database cleanup //(cron)// |  _session_kind _utime ​ | | Database cleanup //(cron)// |  _session_kind _utime ​ |
-| Session explorer |  _session_kind ipAddr ​_utime ​//​WHATTOTRACE// ​ | +| Session explorer |  _session_kind ipAddr ​_httpSessionType ​//​WHATTOTRACE// ​ | 
-| Session explorer (persistent sessions) |  _session_kind _session_uid ​ |+| Session explorer (persistent sessions) |  _session_kind _session_uid ​ipAddr _httpSessionType //​WHATTOTRACE// ​ |
 | Session restrictions |  _session_kind ipAddr //​WHATTOTRACE// ​ | | Session restrictions |  _session_kind ipAddr //​WHATTOTRACE// ​ |
 | Password reset by email |  user  | | Password reset by email |  user  |
Line 52: Line 52:
  
   CREATE UNLOGGED TABLE sessions (   CREATE UNLOGGED TABLE sessions (
-    ​id varchar(64) not null primary key, +      ​id varchar(64) not null primary key, 
-    a_session text, +      a_session text, 
-    _whatToTrace text, +      _whatToTrace text, 
-    _session_kind text, +      _session_kind text, 
-    _utime bigint, +      _utime bigint, 
-    _httpSessionType text, +      _httpSessionType text, 
-    user text, +      ipAddr text
-    ​ipAddr text+
   );   );
-  CREATE INDEX uid1 ON sessions USING BTREE (_whatToTrace);​+  CREATE INDEX uid1 ON sessions USING BTREE (_whatToTrace ​text_pattern_ops);
   CREATE INDEX s1   ON sessions (_session_kind);​   CREATE INDEX s1   ON sessions (_session_kind);​
   CREATE INDEX u1   ON sessions (_utime);   CREATE INDEX u1   ON sessions (_utime);
   CREATE INDEX ip1  ON sessions USING BTREE (ipAddr);   CREATE INDEX ip1  ON sessions USING BTREE (ipAddr);
   CREATE INDEX h1   ON sessions (_httpSessionType);​   CREATE INDEX h1   ON sessions (_httpSessionType);​
- 
  
 <note important>​For Session Explorer and one-off sessions, it is recommended to use BTREE or any index method that indexes partial content.</​note>​ <note important>​For Session Explorer and one-off sessions, it is recommended to use BTREE or any index method that indexes partial content.</​note>​
Line 80: Line 78:
 ^  Required parameters ​ ^^^ ^  Required parameters ​ ^^^
 ^  Name  ^  Comment ​ ^  Example ​ ^ ^  Name  ^  Comment ​ ^  Example ​ ^
-|  **DataSource** ​ | The [[https://​metacpan.org/​pod/​DBI|DBI]] string | dbi:​Pg:​database=sessions ​|+|  **DataSource** ​ | The [[https://​metacpan.org/​pod/​DBI|DBI]] string | dbi:​Pg:​database=lemonldap-ng ​|
 |  **UserName** ​ | The database username | lemonldapng | |  **UserName** ​ | The database username | lemonldapng |
 |  **Password** ​ | The database password | mysuperpassword | |  **Password** ​ | The database password | mysuperpassword |
-|  **Index** ​ | Index | _whatToTrace ipAddr _session_kind _utime |+|  **Index** ​ | Index | _whatToTrace ipAddr _session_kind _utime ​_httpSessionType | 
 +|  **TableName** ​ | Table name (optional) | sessions ​|
  
 <note tip>​Apache::​Session::​Browseable::​MySQL doesn'​t use locks so performances are keeped. <note tip>​Apache::​Session::​Browseable::​MySQL doesn'​t use locks so performances are keeped.
Line 127: Line 126:
       _session_kind text,       _session_kind text,
       _utime bigint,       _utime bigint,
-      ​user text, +      ​_httpSessionType ​text, 
-      ipAddr ​varchar(64)+      ipAddr ​text
   );   );
   CREATE INDEX uid1 ON sessions USING BTREE (_whatToTrace text_pattern_ops);​   CREATE INDEX uid1 ON sessions USING BTREE (_whatToTrace text_pattern_ops);​
-  CREATE INDEX _s1 ON sessions (_session_kind);​ +  CREATE INDEX s1   ON sessions (_session_kind);​ 
-  CREATE INDEX _u1 ON sessions (_utime); +  CREATE INDEX u1   ON sessions (_utime); 
-  CREATE INDEX ip1 ON sessions USING BTREE (ipAddr)+  CREATE INDEX ip1  ON sessions USING BTREE (ipAddr)
 +  CREATE INDEX h1   ON sessions (_httpSessionType);​
  
 **Browseable::​MySQL**:​ **Browseable::​MySQL**:​