necouchman commented on PR #711:
URL: https://github.com/apache/guacamole-client/pull/711#issuecomment-1207208780

   While I generally lean toward using `JOIN` instead of nested queries in SQL, 
and I'm skeptical of situations like this, I _think_ this actually makes sense 
- it is pre-sorting and eliminating potentially a bunch of extra data from the 
`guacamole_user_history` table that then doesn't have to be `JOIN`ed to the 
data pulled out of the `guacamole_user` table.
   
   The only situation where I think this may end up being sub-optimal is if, 
for some reason, the data in the `guacamole_user_history` table is more 
fragmented or unsorted, and the `ORDER BY start_date DESC` and then `LIMIT 1` 
cost ends up high, but even in those situations it still may be lower cost than 
having to pull out all of the `guacamole_user_history` records and `JOIN`ing 
them.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to