From: Michael Stone <mstone+postgres@mathom.us>
To: pgsql-performance@postgresql.org
Subject: Re: Performance of count(*)
Date: Thu, 22 Mar 2007 13:39:32 -0400
Message-ID: <20070322173930.GI11402@mathom.us> (raw)
In-Reply-To: <4602BC84.8030101@wildenhain.de>
References: <Pine.LNX.4.62.0703221149210.13747@wr-linux02>
<200703221208.19358.albert@sedifa.com>
<Pine.LNX.4.64.0703221323590.1503@ismoli.solenovo.jns>
<20070322141807.GE11402@mathom.us>
<46029DE3.9030505@modgraph-usa.com>
<4602A15B.7000908@wildenhain.de>
<4602BB19.9050306@modgraph-usa.com>
<4602BC84.8030101@wildenhain.de>
On Thu, Mar 22, 2007 at 06:27:32PM +0100, Tino Wildenhain wrote:
>Craig A. James schrieb:
>>You guys can correct me if I'm wrong, but the key feature that's missing
>>from Postgres's flexible indexing is the ability to maintain state
>>across queries. Something like this:
>>
>> select a, b, my_index_state() from foo where ...
>> offset 100 limit 10 using my_index(prev_my_index_state);
>>
>
>Yes, you are wrong :-) The technique is called "CURSOR"
>if you maintain persistent connection per session
>(e.g. stand allone application or clever pooling webapplication)
Did you read the email before correcting it? From the part you trimmed
out:
>The problem is that relational databases were invented before the web
>and its stateless applications. In the "good old days", you could
>connect to a database and work for hours, and in that environment
>cursors and such work well -- the RDBMS maintains the internal state of
>the indexing system. But in a web environment, state information is
>very difficult to maintain. There are all sorts of systems that try
>(Enterprise Java Beans, for example), but they're very complex.
It sounds like they wrote their own middleware to handle the problem,
which is basically what you suggested (a "clever pooling web
application") after saying "wrong".
Mike Stone
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: mstone+postgres@mathom.us
Subject: Re: Performance of count(*)
In-Reply-To: <20070322173930.GI11402@mathom.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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