In SQLite:
2 inner joins took about 10 seconds. 3 inner joins in one query were taking 10 minutes.
I was using inner joins to filter - ie shrink the table - when a row had multiple fields in one column (eg, a house has 1 front door but 3 bathrooms).
What should happen in SQLite is that each progressive inner join should make the search table smaller, not bigger. So a 3-join query should be quicker than a 2-join query.
The solution was to create some temp tables, do 1 inner join at a time, and shrink the temp tables down myself.
Now a query with 4 inner joins takes 8 seconds, without changing a line of SQLite. You can't tell me that's not a bug! :-)