views:

128

answers:

1

Hello,

I have two tables on mysql: users, and management. The users table has a numeric id, and the management table has a varchar foreign key which is the primary key of the other table. The types are not the same, and this seems to be the main problem when I build an index from the User model, and try to include one column from the management table. The join that thinkinx sphinx generates takes too much damn time to execute, and thus the index never gets done. I know the best solution is to change the management table and use a numeric id, but right now that seems to be too expensive. Is there a way to just tell thinking sphinx that the varchar field is in fact a numeric id, so the index could be generated without altering the tables?

If this is not clear, please ask me to clarify whatever seems too obscure.

Thanks!

A: 

I'd make sure you have a database index on your foreign key.

Also, if you want to edit the generated configuration, you can do so, and then process the index using one of the two options, which doesn't automatically regenerate the file:

rake ts:index INDEX_ONLY=true
rake ts:reindex # this was only added the other day
pat
I think this may work.. I'll come back to it next monday and tell you how it went. Thanks!
Mr. Leinad