Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^2: PERL DBI MODULE

by erix (Vicar)
on May 19, 2014 at 13:47 UTC ( #1086665=note: print w/ replies, xml ) Need Help??


in reply to Re: PERL DBI MODULE
in thread PERL DBI MODULE

You're right.

Of course one could union several queries together, like so (assuming the same table t):

( select * from t where coln1='?' ) union all ( select * from t where coln2='?' ) union all ( select * from t where coln3='?' ) -- ... (etcetera)

This way there is only one database/network trip. Of course, it can easily make the call side (application) more complicated and I wouldn't recommend it. But it's not so long ago that that performance gain could be irresistable.


Comment on Re^2: PERL DBI MODULE
Download Code
Re^3: PERL DBI MODULE
by chacham (Curate) on May 19, 2014 at 15:03 UTC

    Of course, it can easily make the call side (application) more complicated

    Yep. To know which clause returned which data might require more work. Without the context, it's hard to tell.

    As for network usage, on queries that return more data, the sending is insignificant. But i think you already said that. :)

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (6)
As of 2014-10-31 23:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (225 votes), past polls