If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > PHP > how to enhance table with one million rows ?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-21-12, 22:32
a1228 a1228 is offline
Registered User
 
Join Date: Jan 2012
Posts: 3
how to enhance table with one million rows ?

hello

i have an table with about one million rows , and all my queries is just select by id , what is the best practice to enhance the performance of this table ?

thanks
Reply With Quote
  #2 (permalink)  
Old 01-22-12, 07:07
gvee gvee is offline
www.gvee.co.uk
 
Join Date: Jan 2007
Location: UK
Posts: 10,156
Best answer I can give with the little detail provided: clustered index on the ID field.
__________________
George
Twitter | Blog
Reply With Quote
  #3 (permalink)  
Old 01-23-12, 16:02
a1228 a1228 is offline
Registered User
 
Join Date: Jan 2012
Posts: 3
thanks for replaying gvee

i have table `topics` like that
id - title - topic
1 one topic num one
2 two topic num. two
3 three topic num. three
. . .
. . .
. . .
1000000 million topic num. million

and when i want to retrieve topic contents i use this query

SELECT `topic` FROM `topics` WHERE `id`= $topicId ;

sometimes query like that take some time one second or two

so i wonder how can i enhance that ,
Reply With Quote
Reply

Tags
enhance, mysql

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On