To answer your question in short, db_query is the fastest! Here are some reasons, facts and figure compiled from different questions, sources:
A simple googling of this question, come up with following results:
For simple queries, db_query() is 22% faster than db_select()
For simple queries, db_query() is 124% faster than EFQ
For queries with two joins, db_query() is 29% faster than db_select()
and this
db_query():
Total Incl. Wall Time (microsec): 796 microsecs
Total Incl. CPU (microsecs): 0 microsecs
Total Incl. MemUse (bytes): 123,352 bytes
Total Incl. PeakMemUse (bytes): 124,248 bytes
Number of Function Calls: 38
db_select()
Total Incl. Wall Time (microsec): 1,118 microsecs
Total Incl. CPU (microsecs): 0 microsecs
Total Incl. MemUse (bytes): 425,216 bytes
Total Incl. PeakMemUse (bytes): 436,392 bytes
Number of Function Calls: 88
If you notice above db_select makes more function calls and utilize more memory than db_query.
- See here for reasons on why to use db_select
- See here for reasons on why to use EntityFieldQuery over
db_select
- See here for performance comparison of db_query and db_select
I guess the choice should be solely based on your requirements. EntityFieldQuery might be slower but, offers many advantages such as simple syntax, field storage is pluggable, loose coupling and many more.