Re: Updating session id based on accesstimeout

From: Jamie Lawrence <postgres(at)jal(dot)org>
To: Andreas Heissenberger <aheissen(at)a1(dot)net>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Updating session id based on accesstimeout
Date: 2003-11-29 19:34:20
Message-ID: 20031129193420.GA32196@clueinc.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)jal(dot)org
"God created the integers, all else is the work of man."
- Kronecker

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Michalis Kabrianis 2003-11-30 10:21:34 Permissions problem on 7.4
Previous Message Joe Conway 2003-11-29 18:25:58 Re: Seq Scans when index expected to be used