in reply to Re^5: Need DBM file that holds data up to 50,000 bytes
in thread Need DBM file that holds data up to 50,000 bytes

What I remember is that select * from foo; where foo has millions of records, wil build the complete list as result set before it returns the first record. That may take long.

Isn't that true of every RDBMS?

And isn't it unavoidable (without the use of LIMIT) when using DBI? (Cos if there is a way around it, I'd love to see it.)


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
  • Comment on Re^6: Need DBM file that holds data up to 50,000 bytes

Replies are listed 'Best First'.
Re^7: Need DBM file that holds data up to 50,000 bytes
by erix (Prior) on Aug 12, 2014 at 15:17 UTC

    Well, for instance Oracle has HINTs. HINTS are a possibility to talk to the SQL server "between the lines" as it were. Inside comments (that are formatted a certain way) you can (for instance) HINT a preference for faster response times (as opposed to greater general throughput).

    A quick google yields for instance this page (look for hint FIRST_ROWS). That page also shows the syntax of HINTing use.

    Or see: Oracle 12 docs

    (The PostgreSQL devs have always rejected the whole HINTing business as a shortcut that would prevent better, more-thorough solutions in the planner/executor later. (Nevertheless, I often think they would be handy...))

Re^7: Need DBM file that holds data up to 50,000 bytes
by Tux (Canon) on Aug 12, 2014 at 18:38 UTC

    Not really. Some databases support record streaming. When an index can be used or a full table scan is done, records can be given on demand:

    my $sth = $dbh->prepare ("select * from big_table order by key"); $sth->execute; # Will find the execution plan while (my $row = $sth->fetch) { # first row returned immediate # do something }

    Some databases however will build up a complete result set (of all records) before returning the first.


    Enjoy, Have FUN! H.Merijn