Is there a performance hit for querying two different databases? I have two tables, A and B, which are located in different databases on the same MySQL server.  I would like to create a derived table C from tables A and B, as an inner join between the two tables.

Something like this (pseudo-code):

create table C as select A.gene, B.pubmed_id, B.pubmed_text from A inner join B ...


Will there be a performance hit in doing so? Would it be more prudent to load tables A and B into the same database? These are both very big tables with millions of records.
There is essentially no difference between table and db.table.  Once the tables (for SELECT or for INSERT) is opened, it is just a table, regardless of what database it is in.