From: | Network Administrator <netadmin(at)vcsn(dot)com> |
---|---|
To: | Doug McNaught <doug(at)mcnaught(dot)org> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: Interfaces that support cursors |
Date: | 2003-10-10 18:20:21 |
Message-ID: | 1065810021.3f86f865e9b0e@webmail.vcsn.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Quoting Doug McNaught <doug(at)mcnaught(dot)org>:
> Network Administrator <netadmin(at)vcsn(dot)com> writes:
>
> > Ok, I did see the autocommit flag setting in DBD:Pg when I starting
> > reading up on the DBI/DBD interfacing methods so I guess I could
> > recode for that. However, how do you "maintain" the current
> > transaction open if your script is writing pages to the web. Even
> > in mod_perl I think that there is a commit after the script ends,
> > no?
>
> Oh, right--I didn't get that bit of your problem.
>
> I think the conventional wisdom on this is that keeping transactions
> open across web page deliveries is a Bad Idea. If you're just doing
> the standard "show N records per page" thing, you can use LIMIT and
> OFFSET on your SELECT call. This is going to be slower thn using a
> transaction (because you're re-executing the query for every page) but
> is fairly simple.
>
> If you really want to have a DB transaction that covers multiple page
> views, you need some kind of persistent application server rather than
> CGI scripts, so you can keep open connections and application state
> around.
>
> -Doug
>
Ahhh, I didn't know about the offset part of limit. Sounds like winner- might
not be that bad since the query optimizer takes that into account when planning.
Thanks Doug.
--
Keith C. Perry
Director of Networks & Applications
VCSN, Inc.
http://vcsn.com
____________________________________
This email account is being host by:
VCSN, Inc : http://vcsn.com
From | Date | Subject | |
---|---|---|---|
Next Message | Jonathan Bartlett | 2003-10-10 18:25:51 | Re: Interfaces that support cursors |
Previous Message | Bruno Wolff III | 2003-10-10 18:10:28 | Re: Table partitioning for maximum speed? |