The difference in performance between the two queries are minimal, they are milliseconds thing, but you have to keep in mind how the answer above said "better one queries than two", because two queries besides possibly bring you redundant data to your view, also you would have to make a whole loop of interaction between them until you get the desired result, so whatever way you are working on your system, whenever you are going to present some result on the screen to your users, always try to have it in 1 query (however, we know that it is not always possible), always seeking to use the native syntaxes of your BD to avoid as much as possible that you have to do validations and derivatives on the client part, always seek to already bring the correct data from your server and just take care to show them in your client side.
I hope I’ve helped and beaten.
See you around.
What is the doubt then?
– user28595
Depending on the use and context, there are other factors as well as the use of indexes. Who can answer this is the database, use the command
explain
to find out about the plan for the implementation of the consultation.– rray