List:General Discussion« Previous MessageNext Message »
From:Vivek Khera Date:July 14 1999 2:36pm
Subject:how to emulate "cursors"
View as plain text  
I have an application where I need to select certain random values
from a select set.  The obvious way to do it is via cursors.  That is, 
I perform the select, generate the random numbers, then seek the
cursor that position in the set to retrieve the row.  The data set is
*way* big and will not fit into memory, so that's not a viable option.

Right now, I'm doing a COUNT() on the dataset, then performing
repetitive "SELECT ... LIMIT N,1" where N is my random number.
Needless to say, this is very inefficient!

Is there some good way to emulate the cursor functionality from the
Perl DBI interface?

Vivek Khera, Ph.D.                Khera Communications, Inc.
Internet: khera@stripped       Rockville, MD       +1-301-545-6996
PGP & MIME spoken here  
how to emulate "cursors"Vivek Khera14 Jul
  • how to emulate "cursors"sinisa14 Jul
    • Re: how to emulate "cursors"Vivek Khera14 Jul
      • Re: how to emulate "cursors"sinisa15 Jul
  • Re: how to emulate "cursors"Orlando Andico14 Jul
    • Re: how to emulate "cursors"Vivek Khera14 Jul
      • Re: how to emulate "cursors"Orlando Andico14 Jul
  • Null columns in indexesChris Cleveland18 Jul
    • Re: Null columns in indexesPaul DuBois18 Jul
  • how to emulate "cursors"Michael Widenius30 Jul