Skip site navigation (1) Skip section navigation (2)

Re: Suspending SELECTs

From: August Zajonc <augustz(at)augustz(dot)com>
To: Alessandro Baretta <a(dot)baretta(at)barettadeit(dot)com>
Subject: Re: Suspending SELECTs
Date: 2006-01-22 16:04:29
Message-ID: 43D3AD0D.9050201@augustz.com (view raw or flat)
Thread:
Lists: pgsql-performance
Alessandro Baretta wrote:
> 
> What I could do relatively easily is instantiate a thread to iteratively
> scan a traditional cursor N rows at a time, retrieving only record keys,
> and finally send them to the query-cache-manager. The application thread
> would then scan through the cursor results by fetching the rows
> associated to a given "page" of keys. I would have to keep the full
> cursor keyset in the application server's session state, but, hopefully,
> this is not nearly as bad as storing the entire recordset.
> 
> Alex
> 
> 
> 

Alessandro,

I've very much enjoyed reading your thoughts and the problem your facing
and everyone's responses.

Since you control the middle layer, could you not use a cookie to keep a
cursor open on the middle layer and tie into it on subsequent queries?

If you are concerned with too many connections open, you could timeout
the sessions quickly and recreate the cursor if someone came back. If
they waited 5 minutes to make the next query, certainly they could wait
a few extra seconds to offset and reacquire a cursor?

The hitlist idea was also a nice one if the size of the data returned is
not overwhelming and does not need to track the underlying db at all
(ie, no refresh).

Mark had a number of good general suggestions though, and I'd like to
echo the materialized views as an option that I could see a lot of uses
for (and have worked around in the past with SELECT INTO's and like).

Interesting stuff.

- August

In response to

Responses

pgsql-performance by date

Next:From: pgsql-performanceDate: 2006-01-22 20:29:01
Subject: Re: tsearch2 headline and postgresql.conf
Previous:From: Oleg BartunovDate: 2006-01-22 08:24:55
Subject: Re: tsearch2 headline and postgresql.conf

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group