I am wondering the best format to lay out my data in a mySQL table so that it can be queried in the fastest manner to gather an array of daily values to be further utilized by php.

So far, I have laid out the table as such: 

```
item_id    price_date     price_amount
      1    2000-03-01             22.4
      2    2000-03-01            19.23
      3    2000-03-01             13.4
      4    2000-03-01            14.95
      1    2000-03-02             22.5
      2    2000-03-02            19.42
      3    2000-03-02             13.4
      4    2000-03-02            13.95

```

with item\_id defined as an index.

Also, I am using:

```
"SELECT DISTINCT price_date FROM table_name" 

```

to get an array containing a unique list of dates.

Furthermore, the part of the code that is within a loop (and the focus of my optimization question) is currently written as:

```
"SELECT price_amount FROM table_name WHERE item_id = 1 ORDER BY price_date"

```

This second "SELECT" statement is actually within a loop where I am selecting/storing-in-array the daily prices of each item\_id requested.

All is currently functioning and pulling the data from mySQL properly, however, both the above listed "SELECT" statements are taking approx 4-5 seconds to complete per each run, and when looping through 100+ products to create a summary, adds up to a very inefficient/slow information system.

Is there any more-efficient way that I could structure the mySQL table and/or SELECT statements to retrieve the results faster? Perhaps defining a different index on a different column? I have used the EXPLAIN command to return information per the queries but am unsure how to use the EXPLAIN information to increase the efficiency of my queries.

Thanks in advance for any mySQL wizards that may be able to assist.