Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: fastest method to use DBI

by targetsmart (Curate)
on Jul 07, 2009 at 05:01 UTC ( [id://777738]=note: print w/replies, xml ) Need Help??


in reply to fastest method to use DBI

I entered into perlmonks with the same question. :)
see What are effective methods for retriving many number of rows from postgreSQL tables using perl DBI?


Vivek
-- 'I' am not the body, 'I' am the 'soul', which has no beginning or no end, no attachment or no aversion, nothing to attain or lose.

Replies are listed 'Best First'.
Re^2: fastest method to use DBI
by Anonymous Monk on Jul 07, 2009 at 05:21 UTC
    Hi, It would be great help if get an expert comment on the code. Thanks
      is it the right way to get the fastest fetch?
      I don't know, you have run it and give some statistics on the time taken, memory consumption of the perl program, etc.

      It would be great help if get an expert comment on the code
      I am not a database expert, but IMHO using the database query's OFFSET AND LIMIT is the best way to fetch huge number of records, it is will take only minimum memory(depending on the offset and limit values), and effective values for limit will enable you to fetch all records in a optimum number of fetch cycles.


      Vivek
      -- 'I' am not the body, 'I' am the 'soul', which has no beginning or no end, no attachment or no aversion, nothing to attain or lose.

        Let me to oppose. OFFSET is not good for performance at all (BTW there's no OFFSET in Oracle AFAIK). When you executing query like

        SELECT name,phone ORDER BY name OFFSET 1000000 LIMIT 10
        your database should iterate over first 1000000 records before it will start returning records, this is very slow.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://777738]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (5)
As of 2024-04-24 00:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found