Re: (Fwd) DBI's method for reading [row x,field y]
- From: "Bob" <catdogbeloved@xxxxxxxxx>
- Date: 27 Feb 2007 23:46:02 -0800
On Feb 28, 5:59 am, Jacqui.Ca...@xxxxxxxx (Jacqui Caren) wrote:
Martin J. Evans wrote:
Of course, selectall/fetchall_arrayref retrieves all the rows in the
result-set so this will use that amount of memory up but given you are
already doing this I guess that won't bother you (unless Pg uses cursors
to navigate to the required row). To my knowledge, DBI does not support
fetching only a specific row via a cursor but I'm sure someone will
correct me if I'm wrong on that.
PostgreSQL does NOT provide any mechanism to navigate in the way bob
suggests. He is using a dataset driver and this is doing a
fetchall_arrayref (equivalent) under the covers.
The other things I would point out that recent versions of
PostgreSQL will often randomly order result sets that do not have an
explicit order by clause. This is good as it is a significant
performance boost but does catch the unwary (including myself when I had
a missing order by clause!).
If the past I have found people using code similar to bobs without
an order by clause - often random results and perfomance (as system
scales) instigate a complete redesign soon after.
Jacqui
Jacqui, if I understand your point, I think you have skipped one of my
messages. The result sets are ordered in my case; so much that I use
extensively queries of the type ->getvalue($r+$i,$f-$j), where the
record and field number are displaced by variables while traversing
the database. The structure of the result sets is of paramount
importance for the getvalue calls to succeed.
However, I fail with the more general statement that unordered result
sets will "instigate a complete redesign". Sets are unordered by
definition, in mathematics, and are legal objects in databases.
Bob
.
- References:
- (Fwd) DBI's method for reading [row x,field y]
- From: Tim Bunce
- Re: (Fwd) DBI's method for reading [row x,field y]
- From: Martin J. Evans
- Re: (Fwd) DBI's method for reading [row x,field y]
- From: Jacqui Caren
- (Fwd) DBI's method for reading [row x,field y]
- Prev by Date: Re: (Fwd) DBI's method for reading [row x,field y]
- Next by Date: Re: (Fwd) DBI's method for reading [row x,field y]
- Previous by thread: Re: (Fwd) DBI's method for reading [row x,field y]
- Next by thread: RE: (Fwd) DBI's method for reading [row x,field y]
- Index(es):
Relevant Pages
|
|