pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: John DeSoi <desoi@pgedit.com>
To: Joel Fradkin <jfradkin@wazagua.com>
Cc: 'Bob Henkel' <luckyratfoot@gmail.com>
Cc: 'Scott Marlowe' <smarlowe@g2switchworks.com>
Cc: 'Andrew Sullivan' <ajs@crankycanuck.ca>
Cc: 'Tom Lane' <tgl@sss.pgh.pa.us>
Cc: pgsql-sql@postgresql.org
Subject: Re: getting count for a specific querry
Date: Sat, 9 Apr 2005 11:00:20 -0400
Message-ID: <177B93D9-A908-11D9-92FA-000A95B03262@pgedit.com> (raw)
In-Reply-To: <004b01c53c72$5e4c6390$797ba8c0@jfradkin>
References: <004b01c53c72$5e4c6390$797ba8c0@jfradkin>


On Apr 8, 2005, at 3:37 PM, Joel Fradkin wrote:

> I don't think my clients would like me to aprox as it is a count of 
> their
> records. What I plan on doing assuming I can get all my other problems 
> fixed
> (as mentioned I am going to try and get paid help to see if I goofed 
> it up
> some where) is make the count a button, so they don't wait everytime, 
> but
> can choose to wait if need be, maybe I can store the last count with a 
> count
> on day for the generic search it defaults to, and just have them do a 
> count
> on demand if they have a specific query. Our screens have several 
> criteria
> fields in each application.

Here is an interface idea I'm working on for displaying query results 
in PostgreSQL. Maybe it will work for you if your connection method 
does not prevent you from using cursors. I create a cursor an then 
fetch the first 1000 rows. The status display has 4 paging buttons, 
something like this:

|< < rows 1 - 1000 of ? > >|

The user can hit the "next" button to get the next 1000. If less than 
1000 are fetched the ? is replaced with the actual count. They can 
press the "last" button to move to the end of the cursor and get the 
actual count if they need it. So here the initial query should be fast, 
the user can get the count if they need it, and you don't have to 
re-query using limit and offset.

The problem I'm looking into now (which I just posted on the general 
list) is I don't see a way to get the table and column information from 
a cursor. If I fetch from a cursor, the table OID and column number 
values are 0 in the row description. If I execute the same query 
directly without a cursor, the row description has the correct values 
for table OID and column number.

John DeSoi, Ph.D.
http://pgedit.com/
Power Tools for PostgreSQL




view thread (38+ messages)  latest in thread

Message-ID: <177B93D9-A908-11D9-92FA-000A95B03262@pgedit.com>
Permalink:  ../177B93D9-A908-11D9-92FA-000A95B03262@pgedit.com/
Also on:    postgresql.org/message-id/177B93D9-A908-11D9-92FA-000A95B03262@pgedit.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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: desoi@pgedit.com, jfradkin@wazagua.com, luckyratfoot@gmail.com, smarlowe@g2switchworks.com, ajs@crankycanuck.ca, tgl@sss.pgh.pa.us
  Subject: Re: getting count for a specific querry
  In-Reply-To: <177B93D9-A908-11D9-92FA-000A95B03262@pgedit.com>
  References: <004b01c53c72$5e4c6390$797ba8c0@jfradkin> <177B93D9-A908-11D9-92FA-000A95B03262@pgedit.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