Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimizing the fetch of map fields (1:N relations) could significantly reduce number of sql statements #16

Open
andyjefferson opened this issue Apr 11, 2016 · 0 comments

Comments

@andyjefferson
Copy link
Member

andyjefferson commented Apr 11, 2016

The load of a Map currently can involve more than 1 SQL. This is embodied in SCOUtils.populateMapDelegateWithStoreData().
In this method we reads in the keys (if persistable), then the values (if persistable), and then the "entries" (ids of keys and values) so we can associate the keys to the values. For a Map<Persistable, Persistable> this means 3 SQL statements.

Issue 282 also had the following, which is effectively the same area.
When we have a Map and want to get the entries (Map.entrySet()), we currently select the "map table". When using a join table to form the relation this will be the join table. When the key / value has its own table we simply have a FK to the key table or value table respectively. We don't join across right now (although there is some code in there that doesn't work for all situations).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant