From: Bob Henkel <luckyratfoot@gmail.com>
To: John DeSoi <desoi@pgedit.com>
Cc: Joel Fradkin <jfradkin@wazagua.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 10:43:07 -0500
Message-ID: <762e5c0504090843121e087c@mail.gmail.com> (raw)
In-Reply-To: <177B93D9-A908-11D9-92FA-000A95B03262@pgedit.com>
References: <004b01c53c72$5e4c6390$797ba8c0@jfradkin>
<177B93D9-A908-11D9-92FA-000A95B03262@pgedit.com>
On Apr 9, 2005 10:00 AM, John DeSoi <desoi@pgedit.com> wrote:
>
>
> 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
Oracle Forms uses a similar method as you described and it works just fine.
It will say Record 1 of ?(But I think the developer can set the amount of
records cached so that if you set it to 10 and queried 5 records it would
say record 1 of 5 because it would be under the cache amount.) Forms also
offers a button that say get hit count. So if you really need to know the
record count you can get it without moving off the current record.
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-sql@postgresql.org
Cc: luckyratfoot@gmail.com, desoi@pgedit.com, jfradkin@wazagua.com, smarlowe@g2switchworks.com, ajs@crankycanuck.ca, tgl@sss.pgh.pa.us
Subject: Re: getting count for a specific querry
In-Reply-To: <762e5c0504090843121e087c@mail.gmail.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