pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Craig A. James <cjames@modgraph-usa.com>
To: Tino Wildenhain <tino@wildenhain.de>
Cc: pgsql-performance@postgresql.org
Subject: Re: Performance of count(*)
Date: Thu, 22 Mar 2007 09:43:08 -0800
Message-ID: <4602C02C.2080703@modgraph-usa.com> (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>

Tino Wildenhain wrote:
>> 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)

That's my whole point: If relational databases had a simple mechanism for storing their internal state in an external application, the need for cursors, connection pools, and all those other tricks would be eliminated.

As I said earlier, relational technology was invented in an earlier era, and hasn't caught up with the reality of modern web apps.

> If its a naive web application you just store your session
> in tables where you can easily maintain the scroll state
> as well.

One thing I've learned in 25 years of software development is that people who use my software have problems I never imagined.  I've been the one who was naive when I said similar things about my customers, and was later embarrassed to learn that their problems were more complex than I ever imagined.

Craig



view thread (41+ messages)  latest in thread

Message-ID: <4602C02C.2080703@modgraph-usa.com>
Permalink:  ../4602C02C.2080703@modgraph-usa.com/
Also on:    postgresql.org/message-id/4602C02C.2080703@modgraph-usa.com

 · 

reply

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: cjames@modgraph-usa.com, tino@wildenhain.de
  Subject: Re: Performance of count(*)
  In-Reply-To: <4602C02C.2080703@modgraph-usa.com>

* 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