-
Notifications
You must be signed in to change notification settings - Fork 35
Lots of Query #15
Comments
When you deal with more involved entities containing collections, it's impossible to do the fetching of all related data from all the involved tables in a single query. So it's been decided to split the fetching process into two phases: first apply all the filters and orderings to fetch the primary keys, then fetch the actual data by those primary keys, which is cheap anyway. Optimizations for such things should appear in future versions, but as for now, we'll just have to cope with that. |
This is not cheap at all. |
I've just explained the reasons. The second query is cheap because it's by primary key. |
I know, but this design is very awful. |
And 6 months later... Nothing changed. |
Read your last two messages. Now please explain to me what made you think that you can talk to me like I owe something to you. Concerning the issue. It is recognized, that's why it isn't closed, but it is not a critical one, since the framework works fine. If you want it to be addressed sooner, instead of giving me another order just post a pull request. |
I have no competence to do that, sorry. Like I said before, i respect you work, but i'm sad to see no change about that in 6 months :( |
This issue will be addressed in 0.4, but I can't make any promises about when it's going to be released. The project lacks funding, so I simply have to give higher priorities to other projects I make a living from. |
Thanks a lot :-) |
@nikita-volkov: Fetching by primary key isn't necessary cheap when it needs to happen hundreds of times. Also, if the database isn't on the same instance, the network latency can really add up. in |
Why Sorm made lots of query ?
One to get the id.
One other to get the other columns.
| SELECT DISTINCT
| t0.id
| FROM
| user
| AS t0
| WHERE t0.name = ?
| LIMIT 1
| - oxman
[debug] s.j.JdbcConnection - Executed statement in 70,066ms:
[debug] s.j.JdbcConnection - Executing statement:
| SELECT
| t0.id, t0.email, t0.password, t0.name
| FROM
| user
| AS t0
| WHERE t0.id = ?
| - 1
The text was updated successfully, but these errors were encountered: