Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

Re: DBD::Sqlite queries slow - and gives wrong results

by NetWallah (Canon)
on Dec 11, 2017 at 21:47 UTC ( #1205306=note: print w/replies, xml ) Need Help??

in reply to DBD::Sqlite queries slow - and gives wrong results

Assuming you have fewer GROUPS than EMPLOYEES, and/or the GROUPS table is indexed by NAME, you could get a slightly faster query by reversing the order of the tables:
select e.* from groups g, employees e ....
FYI - this recommendation is confirmed from

                All power corrupts, but we need electricity.

Replies are listed 'Best First'.
Re^2: DBD::Sqlite queries slow - and gives wrong results
by astroboy (Chaplain) on Dec 11, 2017 at 22:28 UTC
    Thanks, but I run exactly the same query against exactly the same database from SQLiteStudo, and the time goes from many seconds to milliseconds. Also, that doesn't explain why the results are different between Perl and SQL

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (4)
As of 2021-03-02 07:35 GMT
Find Nodes?
    Voting Booth?
    My favorite kind of desktop background is:

    Results (40 votes). Check out past polls.