AnsweredAssumed Answered

Key order in relationships - does it matter ?

Question asked by siplus on Mar 9, 2018
Latest reply on Mar 25, 2018 by BeatriceBeaubien

I always thought that it does matter. For example, a relationship between doctors and appointments, with 50 elements in doctors and 500'000 elements in appointments, meant to "find" today's appointments, can be formulated as


DocID = docID

gDate = AppointmentDate


or as


gDate = AppointmentDate

DocID = DocID


In the first case, evaluating the first condition restricts results to 10'000, the second one should apply on this and deliver.


In the second case, evaluating the first condition restricts the results to 1'000, then comes the second one which has less work to do because the data it has to work on is 10 times less.


If the order does not matter, the discussion ends.

If it does matter, the discussion continues, because I have a relationship that fires a 5-second search on browsing from record to record.