Implementation,Network,Database
Efficiency
To retrieve data from a database a SQL query is sent over a JDBC connection to a remote server.
Efficiency
According to an answer in Programmers Stackexchange the use of a SQL query is discouraged as it introduces a lot of overhead. It should be preferred to send a query to webserver and revieve e.g. a * response. This response could be compressed efficiently.
Beyond that the projection of a query should be minimised:
/* BAD */
select * from verybigtable
/* BETTER */
select id, singlecolumn from verybigtable