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