Apple Interview Question

How to speed up a database query?

Interview Answers

Anonymous

Feb 2, 2015

Don’t select what you don’t need s very common that you need to get only a specific number of records from your database. For example, a blog which is showing ten entries per page. In that case, you should definitely use the LIMIT paramete Avoid queries in loops

Anonymous

Sep 29, 2015

index the field you are using in the where clause or use an indexed field in the where clause