Reference fields are currently hard to deal with when writing SQL queries, since joins require either Concatenations or Substrings, which is neither easy to read nor efficient.
Add a way to store reference fields in two split columns, one for the model, and one for the id.
Easier to join on
Reduce index size => Usually, an index on the “id” part will be enough
I see two solutions for this :
Add a new field type. I do not know if it is possible to this properly since fields are bound to either one or no columns, and this one should be bound to two.
Add a way to declare a function field and the two column fields in one go : Example implementation