Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > Moderated Pro PHP
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
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

 
Old December 23rd, 2008, 09:39 PM
Authorized User
 
Join Date: Dec 2008
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





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





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