Re: (Fwd) DBI's method for reading [row x,field y]



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
.



Relevant Pages

  • Re: SV: Survey: Do you use positioned updates from DBI ?
    ... > where I assume that a select without a 'FOR UPDATE OF column' clause is ... a MODE ANSI database, all cursors (on a single table, without ORDER ... the FOR UPDATE clause is mandatory. ...
    (perl.dbi.users)
  • Re: Alternative for TOP
    ... Tibor Karaszi, SQL Server MVP ... > Is there any alternative for TOP clause apart from Cursors. ...
    (microsoft.public.sqlserver.programming)
  • Re: Alternative for TOP
    ... SET ROWCOUNT 10 ... > Is there any alternative for TOP clause apart from Cursors. ...
    (microsoft.public.sqlserver.programming)