ngraphql
ngraphql copied to clipboard
N+1 issue on 1 to 1 field
I have a table with few one to one fields. If we select a list of the table, we would expect those 1 to 1 fields will be smarly retrieved in a single query right? It seems retrieving 1 by 1 for each row of the table. Is this normal?
that's an overlook, looks like smart load does not cover the one-to-one links. You can try a workaround - after retrieving 'headers', collect Ids and make explicit query to read one-to-one linked entities. that will put them into cache inside entity session, and they will be looked up from there. I will address this in the next iteration