473,472 Members | 2,247 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

INDEX'd fields...any drawbacks?

I have a database, about 12 fields per record and roughly 100,000
records per month.

I would do the following query:

select count(*), type from TABLENAME where field0='23-23-23' group by
type;
the query would run an average of about 2secs. Not bad until I am
running the same query about 1400 times all with slightly different
field0 values.

I added an index for field0...with:
alter table TABLENAME add index (field0);

Now those same queries run about an average of 1/10th of a sec!! My
question is, is there a negative effect by indexing this field?

Obviously you woudn't index all fields...but could you?

Thanks,
--
Woody

In a world without boundaries why
do we need Gates and Windows?
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/my***********...ie.nctu.edu.tw

Jul 19 '05 #1
0 1162

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

Similar topics

0
by: woody at nfri dot com | last post by:
I have a database, about 12 fields per record and roughly 100,000 records per month. I would do the following query: select count(*), type from TABLENAME where field0='23-23-23' group by...
2
by: deko | last post by:
The last 4 lines seem to be screwing up.... any suggestions welcome! - - - - - - - - - - - - - - Dim db As Database Dim tdf As TableDef Dim idxPk As Index Dim idxFld As Field Set tdf =...
1
by: Matthew Wells | last post by:
I have a one to many relationship between two tables. The "one" table has a 5 field PK (total 7 fields, 1400 records) and the "many" table has a 7 field PK (total 15 fields, 1500 records). I...
1
by: Average Bear | last post by:
If anyone could help with this one, I am a bit puzzled. I understand you can create an index using two fields of a database, then use the seek method to find a record based on both fields. My...
10
by: hilz | last post by:
Hi all. I have a table that i create in MsAccess, using ado connection as follows: create table PAYITEM ( PAYITEM_ID COUNTER PRIMARY KEY, PAYITEM_NAME ...
3
by: lauren quantrell | last post by:
In a table design, properties window there is the Indexes/Keys tab. I want to create a few indexes. Row myID is the PK. I also want indexes on rows myOne, myTwo, myThree. In the selected...
29
by: shmartonak | last post by:
For maximum portability what should the type of an array index be? Can any integer type be used safely? Or should I only use an unsigned type? Or what? If I'm using pointers to access array...
2
by: bobby_b_ | last post by:
I have a table where fields 1 and 2 make up the primary key. Because of this, I have a unique composite index on fields 1 and 2 (as required by DB2). Now my question is: Fields 1 and 2 are also...
6
by: john | last post by:
Last week I posted about making a unique index on multiple fields to prevent importing identical records twice. I still have trouble with the nulls in the index. The only way that I can make it...
0
by: tedpottel | last post by:
Hi I am trying to right a script to keep a local copy of my mysql database in a local access file. I was able to do this in Access visual basic, but cannot get it to work in python. The...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.