i have a table with several thousand records. i want to know if adding an index will improve things, example:

-------------------------------------
| id | item | text | runtime | dateline
-------------------------------------

now say i create this query:

$stats = mysql_query("
SELECT COUNT(*) as total, AVG(runtime) as avgtime
FROM table WHERE dateline > ".strtotime('6 hours ago')."
");

should dateline be an index?
basically, i would like to know when i should create an index, when an index is not needed, and what columns should be indexes..

any urls which explains all this would be helpful.

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to