Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > PHP/MySQL > Moderated Pro PHP
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Moderated Pro PHP This is a moderated forum for discussing advanced, professional level issues with PHP. Your posts will not appear until a moderator approves them. Posts that are not the right level for this forum will be responded to and you'll be asked to post them in the [url="http://p2p.wrox.com/sql-server-2000-20/9"]Beginning PHP[/url] forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Moderated Pro PHP section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old March 20th, 2008, 04:39 AM
Dragon64
Guest
 
Posts: n/a
Default Need help to Optimize select query

i hav a large mysql database... actually not that big too..
its 10.7 mb in size. but when i make a select query on the table using php, (there is only one table in the database and it contains 89,750 records) it takes around 40 secs to giv the result!!!( I'll be very thankfull if anyone cud help me out.
my table is created like this

CREATE TABLE IF NOT EXISTS `plants` (
  `PID` int(10) NOT NULL default '0',
  `SCI_NAME` varchar(255) NOT NULL default '',
  `COMMON` varchar(255) NOT NULL default '',
  `FAMILY` varchar(255) NOT NULL default '',
  PRIMARY KEY (`PID`)
)ENGINE=MyISAM DEFAULT CHARSET=latin1;

and i m executing this query

select distinct SCI_NAME from plants;

....THANKS IN ADVANCE for Suggestions n solutions

Reply With Quote
  #2 (permalink)  
Old December 23rd, 2008, 09:39 PM
Authorized User
 
Join Date: Dec 2008
Location: London
Posts: 50
Thanks: 1
Thanked 5 Times in 5 Posts
Default

add an other index to your database for the field SCI_NAME, i am not sure i hope it will improve a little bit to the performance.

Thanks
Reply With Quote
Reply


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 Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
SELECT from SELECT query? seananderson Access 1 October 12th, 2007 12:40 AM
optimize inesrt to MDB ishaywei Classic ASP Databases 1 November 27th, 2006 10:36 PM
to optimize the code-urgent mikedeepak Classic ASP Professional 1 November 4th, 2005 03:00 AM
Optimize SQL Statement JpJoe Access 1 June 7th, 2005 08:19 AM
Optimize Raul Classic ASP Databases 3 February 10th, 2004 02:08 PM



All times are GMT -4. The time now is 01:11 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.