Re: [SQL] length of recordset read through a cursor

2003-08-14 Thread Knut P. Lehre
>> After declaring a cursor, one way of obtaining the length of the >resultset >> is to perform a "MOVE 0" and read the PQcmdStatus which returns a >"MOVE nn" >> where nn is the length of the resultset. (A negative MOVE can then be >used >> to allow starting to fetch records from the beginning of

Re: [SQL] length of recordset read through a cursor

2003-08-11 Thread Christoph Haller
> > >> After declaring a cursor, one way of obtaining the length of the > >resultset > >> is to perform a "MOVE 0" and read the PQcmdStatus which returns a > >"MOVE nn" > >> where nn is the length of the resultset. (A negative MOVE can then be > >used > >> to allow starting to fetch records

Re: [SQL] length of recordset read through a cursor

2003-08-09 Thread Rod Taylor
Yes, a move takes less time, but can still a significant amount of time. Do you need to know exactly what to expect? Run ANALYZE recently? A cheat I've used before is to parse the EXPLAIN (not EXPLAIN ANALYZE) output for the expected number of records involved. If that number was less than 2000

Re: [SQL] length of recordset read through a cursor

2003-08-01 Thread Christoph Haller
> > After declaring a cursor, one way of obtaining the length of the resultset > is to perform a "MOVE 0" and read the PQcmdStatus which returns a "MOVE nn" > where nn is the length of the resultset. (A negative MOVE can then be used > to allow starting to fetch records from the beginning of the re

[SQL] length of recordset read through a cursor

2003-07-31 Thread Knut P. Lehre
After declaring a cursor, one way of obtaining the length of the resultset is to perform a "MOVE 0" and read the PQcmdStatus which returns a "MOVE nn" where nn is the length of the resultset. (A negative MOVE can then be used to allow starting to fetch records from the beginning of the resultse