Question: Using Boost.Python, how can I define a module inside another (or rather, as if it were located in a folder)?

Answer: 
Solution (without altering the indexes on my tables):

```

SELECT df.*,
       (
        SELECT dfa.file_archive_id
          FROM dca_file_archive dfa
          WHERE df.file_id = dfa.file_id
          ORDER BY dfa.file_archive_version desc LIMIT 1
       ) as file_archive_id,
       (
        SELECT dfa.file_archive_version
          FROM dca_file_archive dfa
          WHERE df.file_id = dfa.file_id
          ORDER BY dfa.file_archive_version desc LIMIT 1
       ) as file_archive_version
FROM dca_file df

```

Both tables having ~16k rows, this statement takes 0.9 seconds to perform, which is 120x faster than the first join solution.

I know this is not the finest you can do with SQL
t1 as first table,   

t2 as second table   

```
SELECT t1.file_id as tx_id,t1.file_name,tx.file_archive_id,tx.file_archive_version
FROM maindb.t1 t1,maindb.t2 tx
WHERE t1.file_id = tx.file_id
GROUP BY t1.file_id
HAVING max(tx.file_archive_version) >= all (
  SELECT max(t2.file_archive_version)
  FROM maindb.t2
  WHERE t2.file_id = tx_id
)

```

hope it may help.