473,671 Members | 2,113 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

MySQL Indexing general question

I'm a bit confused about indexing using MySQL. I have something like
this:

Table:
PEOPLE

Values:
user_id
first_name
last_name
email

I put an index on user_id to speed up my search for:
select first_name, last_name, email from PEOPLE where user_id=xxx;

The question I have is:
Once I set up the index, does it only hold true for the data that was
currently in the table at the time the index was created? In other
words, if I add 100 more users tomorrow, will I have to rebuild the
index on user_id, or does MySQL automatically adjust for that?

Nino
Jul 19 '05 #1
4 3532
BDR
Yes, Mysql will automatically compensate for additions, entry
modifications and deletions using this type of index. You shouldn't
have to do anything.

Nino Skilj wrote:
I'm a bit confused about indexing using MySQL. I have something like
this:

Table:
PEOPLE

Values:
user_id
first_name
last_name
email

I put an index on user_id to speed up my search for:
select first_name, last_name, email from PEOPLE where user_id=xxx;

The question I have is:
Once I set up the index, does it only hold true for the data that was
currently in the table at the time the index was created? In other
words, if I add 100 more users tomorrow, will I have to rebuild the
index on user_id, or does MySQL automatically adjust for that?

Nino


Jul 19 '05 #2
BDR
Yes, Mysql will automatically compensate for additions, entry
modifications and deletions using this type of index. You shouldn't
have to do anything.

Nino Skilj wrote:
I'm a bit confused about indexing using MySQL. I have something like
this:

Table:
PEOPLE

Values:
user_id
first_name
last_name
email

I put an index on user_id to speed up my search for:
select first_name, last_name, email from PEOPLE where user_id=xxx;

The question I have is:
Once I set up the index, does it only hold true for the data that was
currently in the table at the time the index was created? In other
words, if I add 100 more users tomorrow, will I have to rebuild the
index on user_id, or does MySQL automatically adjust for that?

Nino


Jul 19 '05 #3
Thank you so much!

Nino

BDR <jo*@noemail.co m> wrote in message news:<3F******* *******@noemail .com>...
Yes, Mysql will automatically compensate for additions, entry
modifications and deletions using this type of index. You shouldn't
have to do anything.

Nino Skilj wrote:
I'm a bit confused about indexing using MySQL. I have something like
this:

Table:
PEOPLE

Values:
user_id
first_name
last_name
email

I put an index on user_id to speed up my search for:
select first_name, last_name, email from PEOPLE where user_id=xxx;

The question I have is:
Once I set up the index, does it only hold true for the data that was
currently in the table at the time the index was created? In other
words, if I add 100 more users tomorrow, will I have to rebuild the
index on user_id, or does MySQL automatically adjust for that?

Nino

Jul 19 '05 #4
Thank you so much!

Nino

BDR <jo*@noemail.co m> wrote in message news:<3F******* *******@noemail .com>...
Yes, Mysql will automatically compensate for additions, entry
modifications and deletions using this type of index. You shouldn't
have to do anything.

Nino Skilj wrote:
I'm a bit confused about indexing using MySQL. I have something like
this:

Table:
PEOPLE

Values:
user_id
first_name
last_name
email

I put an index on user_id to speed up my search for:
select first_name, last_name, email from PEOPLE where user_id=xxx;

The question I have is:
Once I set up the index, does it only hold true for the data that was
currently in the table at the time the index was created? In other
words, if I add 100 more users tomorrow, will I have to rebuild the
index on user_id, or does MySQL automatically adjust for that?

Nino

Jul 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
2458
by: Börni | last post by:
Hi, I have an sql query like this: SELECT column FROM table WHERE column1="3" AND column2="1" This query works perfectly if i run it in the command line, to be exactly it return two results. But if i run it from php i just get the first of the two results. Any ideas? Mysql 4.1.8 php 5.0.3
3
6236
by: stan k. | last post by:
First of all i'm on a win32 platform using java. I also have mysql installed. My question isabout benchmarks and multiple inserts & selects SQLITE: http://www.sqlite.org/ HSQL: http://hsqldb.sourceforge.net I current have a mysql database of approx. 80mb. Each day I Insert approx .5mb of new records into this table, and I might also run mutiple Update, Delete, and Select queries as well. I'm trying to get an idea of how fast a sql...
2
2073
by: Craig Stadler | last post by:
I have a fairly large database on my (2 million records) WIN32 mySQL 4.0.20 The question is: I am adding large amounts of data to it (300,000 to 500,000 at a time) with the standard (INSERT INTO) command. Question is, do I have to reindex, and when and how often? Does mySQL automatically build indexes on the fly as I add data?
1
5182
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 expired errors on our views, which i'm assuming is due to the volume of records in our tables. Unfortunately i'm not too experiences w/ indexing tables, so my question is: 1) how do you determine which fields to index (does it have to be a...
108
6372
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 describe if applied to a sequence of length items. It returns a tuple of three integers; respectively these are the /start/ and /stop/ indices and the /step/ or stride length of the slice. Missing or out-of-bounds indices are handled in a manner...
4
8885
by: Vic Cekvenich | last post by:
What would be performance of pgSQL text search vs MySQL vs Lucene (flat file) for a 2 terabyte db? thanks for any comments. ..V -- Please post on Rich Internet Applications User Interface (RiA/SoA) <http://www.portalvu.com> ---------------------------(end of broadcast)--------------------------- TIP 3: if posting/reading through Usenet, please send an appropriate
1
4845
by: jrs_14618 | last post by:
Hello All, This post is essentially a reply a previous post/thread here on this mailing.database.myodbc group titled: MySQL 4.0, FULL-TEXT Indexing and Search Arabic Data, Unicode I was wondering if anybody has experienced the same issues
4
2057
by: Amar | last post by:
Hi All, I need to select data from a database table containing huge amount of data. Now I am storing data using one primary key and I am just using simple select statement, and this process gives me the output but it is taking long to execute the query. As much I had heared I want to use some indexing or cluster indexing which might help me but I am not so familiar with these things. So if any one having some solutions to execute the...
12
1801
by: howa | last post by:
any side effect for PHP? what do you think?
0
8474
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8912
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8819
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7428
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6222
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5692
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4222
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2809
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 we have to send another system
2
2049
muto222
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.