473,471 Members | 1,881 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

indexing

155 New Member
Hello ,i tryed to search for this topic ,and i didn't find!

im new to optimizing mysql by indexing ,and i want to know if it is good?

i got this table with users registration details , i got username, first_name, last_name, and some more !

my question is :

is it good to index all this 3 fields ?

thank's
Nov 2 '09 #1
6 1442
RedSon
5,000 Recognized Expert Expert
Are you looking for a theoretical answer or do you want to know if mysql is efficient in handling multiple indexes on a table?
Nov 2 '09 #2
TheServant
1,168 Recognized Expert Top Contributor
I think that indexing is good if you are doing a lot of searches for that column. I don't think you should be indexing all of those, even if you have a search or regular call to them, unless your queries are getting slow. I wouldn't even think about it until you have 10,000 records, and even then, you might not notice it until 100,000 records. Then best way to organise this is to run a timer script. Make 10,000 dummy records in a table, run a SELECT * WHERE first_name="test" query a few times to get an average for unindexed, and then index the column, and try a few time to get an average for indexed.

If you do this, please post your results and findings as it could be helpful to others. But in short, if you're not doing very populated tables, and regular searches, then don't worry about it. I would always be trying to optimize, and maybe indexing will speed it up a little, and you should run some tests to determine that. However, indexing uses memory, and could be a waste if you don't notice any difference in query time.
Nov 3 '09 #3
canabatz
155 New Member
ok ,i got it!!

one more question :)

i want to understand what query will be faster:

if i do:

SELECT * FROM 'my_table' where id=$id;

and from my_table i only need those columns first_name , last_name, user_name and there is much other columns in the table that i dont need.


or i do like :

SELECT first_name, last_name, user_name FROM `my_table` where id=$id

thanx!!
Nov 3 '09 #4
RedSon
5,000 Recognized Expert Expert
They should be exactly the same because you are pulling the same data set just filtering it. But you should use the analyze functions in your SQL database engine to see how long each takes. That is the purpose of the analyze functions, to see how long things take and optimize from there.
Nov 3 '09 #5
mwasif
802 Recognized Expert Contributor
There will be no performance difference if you are not querying the database frequently. But if you performing queries very frequently then you must get data for only those columns which you need.
Nov 3 '09 #6
canabatz
155 New Member
ok ,thanx :)

one more question :)

i got my database as default MyISAM !

i got some time slow inserts and updates ,there can be like 5 inserts every second
i read that InoDB is better in insert delete and update!

are you recomend to move to InoDB? if i got allot of insert ,update?

thanx
Nov 3 '09 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

21
by: Hilde Roth | last post by:
This may have been asked before but I can't find it. If I have a rectangular list of lists, say, l = ,,], is there a handy syntax for retrieving the ith item of every sublist? I know about for i...
15
by: Jay | last post by:
Hello all. I've recently transferred our web sites from a Windows2000 server to a Windows2003 server. The transfer went almost flawless until I noticed that our search function isn't working...
1
by: Danny | last post by:
sorry for posting a question that has probably been posted hundreds of times, but i can't seem to find the answer i need...We're using a Sql Server 7.0 database and recently started getting timeout...
108
by: Bryan Olson | last post by:
The Python slice type has one method 'indices', and reportedly: This method takes a single integer argument /length/ and computes information about the extended slice that the slice object would...
10
by: Lyle Fairfield | last post by:
By default mdb etc files are not searched by Indexing Service. The default can be changed in Windows XP Pro using Group Policy. I can find no suggested way to make the change in the Windows XO...
7
by: Ryan | last post by:
I have a bit of a problem with regards an indexing strategy. Well, basically there is no indexing strategy on a set of data I have at work. Now, I didn't create the design as I would have allowed...
3
by: Chung Leong | last post by:
Here's the rest of the tutorial I started earlier: Aside from text within a document, Indexing Service let you search on meta information stored in the files. For example, MusicArtist and...
4
by: Emin | last post by:
Dear Experts, How much slower is dict indexing vs. list indexing (or indexing into a numpy array)? I realize that looking up a value in a dict should be constant time, but does anyone have a...
4
by: pratimapaudel | last post by:
I have tables in my database, it's sql server 2005. I heard some of them have indexing and some of them doesnot have indexing. If i want to check whether it has indexing or not how do i do? ...
2
by: =?Utf-8?B?SmVycnkgQw==?= | last post by:
I have a server 2008 IIS 7.0 with indexing service installed. I have created the catalog and have a test page using these posts:...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.