Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

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

by NetWallah (Canon)
on Dec 11, 2017 at 21:47 UTC ( [id://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 https://sql-tuning.com/

                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?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (8)
As of 2024-04-23 17:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found