Personally if you havea one to many relationship and each record in table a only relates to one record in table b, I would store the table b id in table a and then do a regular join to get the data. What you currently have is a bad design that can never be truly efficient.