[eluser]jmadsen[/eluser]
Your problem has nothing to do with CI or Active Record. Really, you should be asking on an sql forum, but we'll do what we can :-)
We need to understand your table sizes are, what indexes you have, can you use views for query, what does your Query optimizer tell you, is this a candidate for a denormalized table, etc.
I'd also like to know what your "_map" tables are..are these JOIN tables, and are they really necessary? It's possible your schema is a little off. Just for example, can you explain this relationship:
Code:
$this->db->join('target_gender_map gender_map', 'gender_map.asset_id = ua.id');
$this->db->join('target_gender t_gender', 't_gender.id = gender_map.gender_id');
If you want us to be able to help you with this, I would first read a bit on query optimization on different websites and see what general types of advice are given, so you can anticipate and supply us with the info we'll need to help you.
After that, happy to make suggestions.