TechSpott - Computer and technology forums

Go Back   TechSpott - Computer and technology forums > Webmasters > Database Management > MySQL
MySQL Forum dedicated to the world's most popular open source database engine.

Reply
 
Thread Tools Display Modes
Old April 13th, 2010, 06:07 AM   #1 (permalink)
Mr Quan
Guest
 
Posts: n/a
Default Will a primary key or index speed up my MySQL table?

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!
  Reply With Quote Share with Facebook
Reply

Bookmarks

Tags
index, key, mysql, primary, speed, table


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
MySQL table join (joining a column from one table to the row of another more like)? Grizzley G MySQL 0 April 12th, 2010 01:17 AM
How do I create this simple table in MySQL? Phew Phewlips MySQL 0 April 5th, 2010 07:24 AM
Sorting PHP MySQL table by links? christopher wood MySQL 1 April 4th, 2010 02:59 AM
How to insert a list from a text file into mysql table ? London MySQL 0 April 2nd, 2010 01:51 AM
How do I make my MySQL table automatically make a timestamp when new data is added? Carbonbased Lifeform MySQL 0 March 31st, 2010 03:40 PM

 
Forum Stats
Members: 14,359
Threads: 20,367
Posts: 27,812
Total Online: 37

Newest Member: Somionimb

Latest Threads

Advertisements

Support our advertisers!

Amazon
Sears
Macys
1800flowers.com
Drugstore.com


Carbonite Online-Backups
Tiger Direct
Tech Depot
Buy.com
Office Depot
Fatcow
HostGator


TripsNow.us
Marriott
Expedia
CheapTickets.com
OneTravel
Hotwire

Are you a Fan?

Share this on Facebook

Tag Cloud

Partner Links


Contact Us - Home - Archive - Privacy Statement - Top - Copyright © 2009-2010, TechSpott - All times are GMT -4. Time is 04:01 PM

Powered by vBulletin® Copyright © Jelsoft Enterprises Ltd. :: SEO by vBSEO