I have a database table that is quite large (9.5 MiB) and has a new row inserted every few seconds. The table structure is like this:...
Table 'readings':
rd_date (datetime)
rd_value (double)
reg_id (int(11))
There are already about 20,000 rows and this number is steadily growing. I have no indexes or primary keys because I never really utilise a single row. This data is graphed using AVG or SUM functions on a time span which has been working nicely.
原帖地å€: TechSpott - Computer and technology forums http://www.techspott.com//showthread.php?p=6802
I've noticed graphing this data has become quite slow and am wondering if adding a primary key will help, even though I would never specifically use it in queries. If so, how would I go about adding a primary key field now that I already have so much data in the table?
I'm quite new at MySQL and mostly use phpmyadmin, and a little command line.
Many thanks!