index on array?

From: "none none" <g(dot)jedenastik(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: index on array?
Date: 2007-11-02 12:36:51
Message-ID: ac01c80a0711020536w69744942qa9d426940895b58f@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

hi(at)ll

currently i try to implement a data structure for tracking my websites
traffic
i'm using a key/value table which contains e.g. http header and/or GET/POST
data
a request table (1 request per row) references to the key/value pairs using
an bigint[] array

the problem seems to be that query's on the array are very slow

what i tried to achive:
store every request and it's metadata in the database to generate statistics
since one request can have 1 to many key/value pairs i try to "artificially"
broaden the table by using an array to reference to the request's metadata

advantage:
the metadata table grows slowly and querys are fast on this table
disadvantage:
request table grows very fast and timely statistics on time periods are very
slow (e.g. how many users used a proxy yesterday,...)

Q1: is there an easy possibility to create an index for the array?
Q2: if yes, how? are there any special query functions for using such
indexes?
Q3: anybody knows an alternative way to store such data without arrays?
Q4: what would be a (in sense of performance) fast alternative (w.o.
arrays)?
Q5: what would be a space saving (e.g. slow growing table) alternative (w.o.
arrays)?

thx(at)ll

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Greg Smith 2007-11-02 12:56:37 Re: young guy wanting (Postgres DBA) ammo
Previous Message Filip Rembiałkowski 2007-11-02 11:53:59 Re: Calculation for Max_FSM_pages : Any rules of thumb?