pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedUpdating session id based on accesstimeout
3+ messages / 3 participants
[nested] [flat]
* Updating session id based on accesstimeout
@ 2003-11-29 18:18 Andreas Heissenberger <aheissen@a1.net>
0 siblings, 2 replies; 3+ messages in thread
From: Andreas Heissenberger @ 2003-11-29 18:18 UTC (permalink / raw)
To: pgsql-sql
Hi,
I want to set a session id based on a session timeout per user. I have a very large logfile with more than 1.3 Mio records and look for a very efficient solution - maybe with PL/pgSQL .
The important columns in the table are: access timestamp and userid sorted by userid and access time.
The logic for the session id is: when ever the userid changes or the time between two following records is greater than 60 sec create a new session id and update the record with this id.
I tried to solve this problem with Perl and the DBI interface - but it took about 12 hours to update all records.
The fastes solution I found until now was not to use any data base, sort the data with the unix command sort and process the logfile text directly with perl.
Thanks in advance!
Andreas
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Updating session id based on accesstimeout
@ 2003-11-29 19:34 Jamie Lawrence <postgres@jal.org>
parent: Andreas Heissenberger <aheissen@a1.net>
1 sibling, 0 replies; 3+ messages in thread
From: Jamie Lawrence @ 2003-11-29 19:34 UTC (permalink / raw)
To: Andreas Heissenberger <aheissen@a1.net>; +Cc: pgsql-sql
On Sat, 29 Nov 2003, Andreas Heissenberger wrote:
> Hi,
>
> I want to set a session id based on a session timeout per user. I have a very large logfile with more than 1.3 Mio records and look for a very efficient solution - maybe with PL/pgSQL .
>
> The important columns in the table are: access timestamp and userid sorted by userid and access time.
> The logic for the session id is: when ever the userid changes or the time between two following records is greater than 60 sec create a new session id and update the record with this id.
>
> I tried to solve this problem with Perl and the DBI interface - but it took about 12 hours to update all records.
> The fastes solution I found until now was not to use any data base, sort the data with the unix command sort and process the logfile text directly with perl.
You won't find a method faster than updating text files, until you stop
brute forcing the data.
Databases don't provide speed, at least in this case. They provide
ACID compliance, and other features.
Perhaps, if you revisit your assumptions, you might find that your need
is solved by a different notion of the problem.
-j
--
Jamie Lawrence jal@jal.org
"God created the integers, all else is the work of man."
- Kronecker
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Updating session id based on accesstimeout
@ 2003-12-03 02:57 greg@turnstep.com
parent: Andreas Heissenberger <aheissen@a1.net>
1 sibling, 0 replies; 3+ messages in thread
From: greg@turnstep.com @ 2003-12-03 02:57 UTC (permalink / raw)
To: pgsql-sql; +Cc: aheissen@a1.net
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
> I want to set a session id based on a session timeout per user. I
> have a very large logfile with more than 1.3 Mio records and look
> for a very efficient solution - maybe with PL/pgSQL .
Can you post a clearer example with the exact columns in the table,
and what you wish to do?
- --
Greg Sabino Mullane greg@turnstep.com
PGP Key: 0x14964AC8 200312022156
-----BEGIN PGP SIGNATURE-----
iD8DBQE/zVDsvJuQZxSWSsgRAnXaAJ9ndHTI7ha9ZyWS+Bnybgbve09jVQCffWTa
H/csLQmY29QTReOH7XYMtHs=
=7xo3
-----END PGP SIGNATURE-----
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2003-12-03 02:57 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-11-29 18:18 Updating session id based on accesstimeout Andreas Heissenberger <aheissen@a1.net>
2003-11-29 19:34 ` Jamie Lawrence <postgres@jal.org>
2003-12-03 02:57 ` greg@turnstep.com
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox