pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Byron Nikolaidis <byronn@insightdist.com>
To: pgsql-interfaces@hub.org <pgsql-interfaces@hub.org>
Subject: [Fwd: [INTERFACES] Use Declare/Fetch option]
Date: Thu, 28 Jan 1999 12:03:34 -0500
Message-ID: <36B09866.43300C3D@insightdist.com> (raw)




Hiroshi Inoue wrote:

> Hello,
>
> I have a question.
>
> > -----Original Message-----
> > From: Byron Nikolaidis [mailto:byronn@insightdist.com]
> > Sent: Thursday, January 28, 1999 1:00 AM
> > To: Hiroshi Inoue
> > Cc: pgsql-interfaces
> > Subject: Re: [INTERFACES] Use Declare/Fetch option
> >
> >
> >
> >
> > Hiroshi Inoue wrote:
> >
> > > Hello all,
> > >
> > > I have a question about psqlodbc driver.
> > > Now the default setting for "Use Declare/Fetch" is false.
> > >
> > > In MVCC thanks to Vadim,readers block no writers.
> > > So we can change the [Use Declare/Fetch] option to true ?
> > > And if so,it's effective ?
> > >
> >
> > All you say is correct.   It probably could go back to true.  But I
> > think some people would probably prefer it stay false, because there is
> > more odbc functionality provided with this setting.  For example, when
> > the option is false, the entire SQLExtendedFetch functionality is
> > supported (prev,first,last,next,absolute,relative,bookmark).  When the
> > Declare/Fetch option is true, only fetch "next" is supported.  There are
>
> Is there somthing wrong with the use "fetch backward"  to support
> SQL_FETCH_PRIOR ?
>

I don't think the "fetch backward" works well enough to support FETCH_PRIOR.
We have experimented with it, and found it to be inconsistent at best,
especially when near the end of the result set.  In fact, if you fetch past
the end of the result set, you can't even back up anyway!  So there is no way
(that I know of) to do something like FETCH_LAST, and then do a FETCH_PRIOR,
because you are already in an bad state.  There is also no good way of knowing
how many rows are in the result set, which makes it impossible to prevent
going off the end.

The cursor management in the backend needs to improve quite a bit.  From what
I understand, it is rather inefficient as well, because when moving around,
the query is actually being re-executed each time.  If it does not improve, I
think the driver would be the best place to manage the result set, and as I
said, in the future I would like to combine the two kinds of access into one,
perhaps even using both memory and file caching for large result sets.

Dave Hartwig has tried to fix the cursor management in the backend -- Maybe he
would like to chime in on this too.

Byron

view thread (4+ messages)  latest in thread

Message-ID: <36B09866.43300C3D@insightdist.com>
Permalink:  ../36B09866.43300C3D@insightdist.com/
Also on:    postgresql.org/message-id/36B09866.43300C3D@insightdist.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-interfaces@postgresql.org
  Cc: byronn@insightdist.com, pgsql-interfaces@hub.org
  Subject: Re: [Fwd: [INTERFACES] Use Declare/Fetch option]
  In-Reply-To: <36B09866.43300C3D@insightdist.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