Or MySQL in this case...any way to optimize this query so it doesn't take so obscenely long to execute? What it's supposed to do (and what I think it is doing) is return the number of posts that were created durning each of the 24 hours in a day.
Code:
mysql> SELECT HOUR(FROM_UNIXTIME(dateline)), COUNT(*) FROM post GROUP BY HOUR(FROM_UNIXTIME(dateline));
+-------------------------------+----------+
| HOUR(FROM_UNIXTIME(dateline)) | COUNT(*) |
+-------------------------------+----------+
| 0 | 941 |
| 1 | 1006 |
| 2 | 560 |
| 3 | 597 |
| 4 | 534 |
| 5 | 533 |
| 6 | 664 |
| 7 | 888 |
| 8 | 978 |
| 9 | 1225 |
| 10 | 1670 |
| 11 | 2017 |
| 12 | 1707 |
| 13 | 1886 |
| 14 | 1980 |
| 15 | 2658 |
| 16 | 3196 |
| 17 | 4150 |
| 18 | 4418 |
| 19 | 3134 |
| 20 | 3503 |
| 21 | 3523 |
| 22 | 2600 |
| 23 | 1595 |
+-------------------------------+----------+
24 rows in set (1.72 sec)