GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  Programming  >  PHP
Go To First  |  Previous Question  |  Next Question 
 PHP  |  Question 68 of 74    Print  
MySQL Query Optimize
What are the different methods to optimize the MySQL query?


  
Total Answers and Comments: 1 Last Update: April 29, 2009     Asked by: nagaphp_indore 
  
 Sponsored Links

 
 Best Rated Answer
Submitted by: svrajput
 
It does not depend upon single entity. In order to optimize it you can look into following things. - Make sure table has primary key. - If there is any field which is used more frequently for searching then index it!. - The order of condition does matters. - In select statement where condition should have indexed column. - Fetch required amount of records from db (use limit clause). e.g. if you want total number of records then use count() function rather than select *.

Above answer was rated as good by the following members:
tips4moin
April 29, 2009 04:36:41   #1  
svrajput Member Since: April 2009   Contribution: 1    

RE: MySQL Query Optimize
It does not depend upon single entity. In order to optimize it you can look into following things. - Make sure table has primary key. - If there is any field which is used more frequently for searching then index it!. - The order of condition does matters. - In select statement where condition should have indexed column. - Fetch required amount of records from db (use limit clause). e.g. if you want total number of records then use count() function rather than select *.
 
Is this answer useful? Yes | NoAnswer is useful 1   Answer is not useful 0Overall Rating: +1    

 Related Questions

What is diff between srand & shuffle2-Mysql command to fetch onlythe unique values?3-how can a script come to a clear termination?4-How do i store binary in my sql?5-How do i limit the no of rows 1 get out of my database ?6- How do i find out weather a no is odd or even ?7-Can I coonect to Ms-access database w/o a DSN?8- How can we remove duplicate values from an array ?9-How an we get the ID genrated from the previous insert operation ?10-Can I run sevral versions of Php of the same time ?
Read Answers (7) | Asked by : shivam awasthi

Latest Answer : While embeding varible to query string use PHP function addslashes()this will solve the problem of any special character. ...
Read Answers (7) | Asked by : Lokesh M

Latest Answer : we have to check the MySQL connection if its not properly get check domain name and password in oracle 10g or 11g you should check the communication port authentication. otherwise it should not create oracle or MySQL error just give time out error .its ...
Read Answers (4) | Asked by : Anu

Latest Answer : MySQL 5.1 supports the following storage engines: MyISAM InnoDB Memory Merge Archive Federated NDB CSV Blackhole http://dev.mysql.com/doc/refman/5.1/en/storage-engine-overview.html ...
Read Answers (1) | Asked by : Prakash

i m creating reports through crystal reports using MySQL database.Now i want to access these reports through php code in web page.Can anyone help me or give me sample code, how to access reports in php 
Latest Answer : In PHP also you can create reports using JP Graphs. :) ...

How do you upload videos using PHP & MySQL 
Latest Answer : For uploading videos you need not store the video in database. Just you store the video path in database. You store the videos in a separate folder like video_uploads. After uploading you can call those videos from the video_uploads folder via MySQL ...
Read Answers (4) | Asked by : ramsari

What are the different methods to optimize the MySQL query? 
Latest Answer : It does not depend upon single entity. In order to optimize it you can look into following things. - Make sure table has primary key. - If there is any field which is used more frequently for searching then index it!. - The order of condition does ...


 Sponsored Links

 
Related Articles

Concepts of Object-Oriented Programming

Object Oriented JavaScript In this chapter you ll learn about OOP Object Oriented Programming and how it relates to JavaScript As an ASP NET developer you probably have some experience working with objects and you may even be familiar with concepts such as inheritance However unless you re already a
 

What is an Ad Hoc Query

An Ad-Hoc Query is a query that cannot be determined prior to the moment the query is issued. It is created in order to get information when need arises and it consists of dynamically constructed SQL which is usually constructed by desktop-resident query tools. This is in contrast to any query which
 

SQL Programming

SQL Programming Overview Anybody who has done something for a long time has probably wanted to change how things work at some point or another. A worker at a mill might have found a more efficient way of cutting logs, or a mathematics teacher might have had a hand in changing a school’s al
 

The Interview Snafu

How to turn someone else’s mistake to your advantage Your dream job is about to become reality. A recruiter gave you the heads up about the perfect position at Humungous Conglomerate, Inc. You went through five interviews as well as a battery of psychological tests mandated by their HR de
 

Winning a Job Interview with a Winning Resume

Does your resume unlock your potential, take your skills to the highest level and win you the interview and the job you want now? The job market today is highly competitive and even if you think you have what it takes to get an interview you won’t get over the line without a polished, prof
 

WinRunner Programming Concepts

If you want to create WinRunner scripts that are highly efficient, there are important programming concepts that you will want to become familiar with. Understanding these concepts will provide you with a large number of key benefits. In addition to understanding these concepts, you must also learn
 

Programming Languages Certification

IT Certification programs have several options that will offer you the best knowledge.  By learning everything that you need to know about information technology you will be able to open new doors to your career and personal business desires.  IT Certification offers several vari
 

Neuro-linguistic Programming Methods

Neuro linguistic Programming Methods There are several methods used for performing Neuro linguistic Programming on an individual for obtaining insights into the psyche of the person in order to correct to modify certain patterns of behavior These techniques are also used for Neuro linguistic trainin
 

Importance of Proper English during Job Interview

Importance of Proper English during Job Interview Your job interview is crucially important and it will determine whether or not you will get the job Depending on the type of job you re going for it is very important for you to use proper English In most cases jobs which offer higher salaries will h
 

The Difficult Past of Neuro-linguistic programming

The Difficult Past of Neuro linguistic programming Neuro linguistic programming has had a rocky past with a number of lawsuits rivalry unsystematic development and intermittent progress During the 1980s the two founders separated after the lawsuit filed by Bandler Bandler went on to file several law
 

About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape