For example, the MySQL table for invoices (date, amount, customer name, etc.).
The user wants to select (display / echo) invoices issued for one specific month (for example, April).
The user then decides to display the invoices issued in April and to one specific customer.
I assume there are 2 options:
1) at each MySQL SELECT query and selection of the required data, or
2) only one MySQL SELECT and selection; create an array with the extracted results; then use / process array
Question: which option would be better for performance? Many MySQL SELECTs use server resources; but, on the other hand, the array also uses resources to store in memory. Which option uses less resources?
source share