using indices with SMALL tables

2016-04-22 Thread Lucio Chiappetti
I am regularly using indices on medium-big tables (1000 to > 5 entries), and even on temporary tables (which I use a lot) in joins (EXPLAIN SELECT is your friend). But I'd never thought indices were needed for small tables (100-200 entries). I recently found they are useful too,

Re: Indices in InnoDB/MySQL

2008-04-06 Thread Baron Schwartz
te on index on > LONG VALUE, the index on LONG VALUE will actually work as a typical > compound index on ID,VALUE. My question is this, if I don't know that No, it will (sort of) work as a compound index on (VALUE, ID). > about MySQL and create my indices on purpose (i.e. not t

Re: Indices in InnoDB/MySQL

2008-04-02 Thread Joerg Bruehe
Hi ! Robert DiFalco wrote: Right, the proof is that if I have an PKEY on ID and an index just on VALUE in MySQL then a query that would use both ID and VALUE works fine with just the index on VALUE. An index is a means to speed up access to the data when the most identifying thing, the primar

RE: Indices in InnoDB/MySQL

2008-04-01 Thread Robert DiFalco
blurry when the PKEY is compound. -Original Message- From: Olexandr Melnyk [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 01, 2008 11:08 AM To: mysql@lists.mysql.com Subject: Indices in InnoDB/MySQL On 4/1/08, Paul DuBois <[EMAIL PROTECTED]> wrote: > > At 10:01 AM -0700 4/

RE: Indices in InnoDB/MySQL

2008-04-01 Thread Robert DiFalco
There is already a primary key index on ID. -Original Message- From: Wm Mussatto [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 01, 2008 10:50 AM To: mysql@lists.mysql.com Subject: Re: Indices in InnoDB/MySQL On Tue, April 1, 2008 10:01, Robert DiFalco wrote: > I've been told

Indices in InnoDB/MySQL

2008-04-01 Thread Olexandr Melnyk
On 4/1/08, Paul DuBois <[EMAIL PROTECTED]> wrote: > > At 10:01 AM -0700 4/1/08, Robert DiFalco wrote: > >I've been told that an index always contains the primary key. > > > By who? > > Ask for proof. I guess he was referring to the fact that InnoDB stores the primary key values alongside the ind

Re: Indices in InnoDB/MySQL

2008-04-01 Thread Paul DuBois
pound index on ID,VALUE. My question is this, if I don't know that about MySQL and create my indices on purpose (i.e. not taking into account implementation details about MySQL) I would create the index explicitly on ID,VALUE. If I did that would I effectively have the same index as one on jus

Re: Indices in InnoDB/MySQL

2008-04-01 Thread Wm Mussatto
x on ID,VALUE. My question is this, if I don't know that > about MySQL and create my indices on purpose (i.e. not taking into > account implementation details about MySQL) I would create the index > explicitly on ID,VALUE. If I did that would I effectively have the same > index a

Indices in InnoDB/MySQL

2008-04-01 Thread Robert DiFalco
MySQL and create my indices on purpose (i.e. not taking into account implementation details about MySQL) I would create the index explicitly on ID,VALUE. If I did that would I effectively have the same index as one on just VALUE or would there some how be duplicate data in the ID,VALUE index (i.e. ID,

Re: Designing Table for Both Global and Local Indices

2007-11-24 Thread Santino
Hi, Try to make a table for each company with only one integer field than insert a record and use the id to populate the other table. You can also delete periodically records from there companies tables. Santino At 21:48 -0500 23-11-2007, David T. Ashley wrote: Hi, I am developing a large dat

Designing Table for Both Global and Local Indices

2007-11-23 Thread David T. Ashley
Hi, I am developing a large database where the web interface may be shared among many companies, but the data will generally not be shared. For the purposes of example, let's call it a bug tracking system such as Bugzilla. Each company has their own private software bugs. Many companies may ent

Re: what kind of indices to set up

2007-04-26 Thread Baron Schwartz
Gerald L. Clark wrote: James Tu wrote: I was a little to quick with the send button. Can you do a query like this: (I know that the * syntax is not correct, but is there something equivalent to it? SELECT from cars WHERE make=5 AND model=* AND body_color=7 AND tire_type = *

Re: what kind of indices to set up

2007-04-26 Thread Gerald L. Clark
James Tu wrote: I was a little to quick with the send button. Can you do a query like this: (I know that the * syntax is not correct, but is there something equivalent to it? SELECT from cars WHERE make=5 AND model=* AND body_color=7 AND tire_type = * AND hub_caps_type =

Re: what kind of indices to set up

2007-04-26 Thread James Tu
one of the indices is used. What is the proper way to setup indices in this case? Shoud I add an Index for each of these fields OR create a multicolumn index using all of these fields? -James -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscrib

Re: what kind of indices to set up

2007-04-25 Thread Joerg Bruehe
Hi James, all, James Tu wrote: What do you guys think of this approach... Always query on all 5 columns...and then create a multicolumn index using all 5 columns? From a database point of view, that would be best - but I am not sure whether it fits your application and the users. Some poi

Re: what kind of indices to set up

2007-04-24 Thread James Tu
just model = 22 I read that MySQL only uses one index when it performs a query. I did an EXPLAIN and it appears that only one of the indices is used. What is the proper way to setup indices in this case? Shoud I add an Index for each of these fields OR create a multicolumn index using all of th

Re: what kind of indices to set up

2007-04-24 Thread James Tu
any of the fields as criteria. For example someone might search for : body_color = 1 AND tire_type = 11 or just model = 22 I read that MySQL only uses one index when it performs a query. I did an EXPLAIN and it appears that only one of the indices is used. What is the proper way to setup indices in

Re: what kind of indices to set up

2007-04-23 Thread mos
model = 22 I read that MySQL only uses one index when it performs a query. I did an EXPLAIN and it appears that only one of the indices is used. What is the proper way to setup indices in this case? Shoud I add an Index for each of these fields OR create a multicolumn index using all of these fields

what kind of indices to set up

2007-04-23 Thread James Tu
search for : body_color = 1 AND tire_type = 11 or just model = 22 I read that MySQL only uses one index when it performs a query. I did an EXPLAIN and it appears that only one of the indices is used. What is the proper way to setup indices in this case? Shoud I add an Index for each of these

Re: Max number of 64 indices per table?

2007-01-26 Thread Francesco Riosa
Horst Jäger ha scritto: Hi everyone, the number of incices per table seems to be restricted to 64. Any way to change that? recompile with "configure --with-max-indexes=128" I'm using MySQL 5.0.27 . -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscrib

Max number of 64 indices per table?

2007-01-26 Thread Horst Jäger
Hi everyone, the number of incices per table seems to be restricted to 64. Any way to change that? I'm using MySQL 5.0.27 . Thanks in advance Horst -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

Prefix Indices

2006-10-17 Thread Robert DiFalco
I have some long VARCHAR fields that a user will sometimes sort on. Does a prefix index in any way help with sorting or just for lookups? Will it speed up a filesort? I couldn't find this information in "How MySQL uses indices". R. -- MySQL General Mailing List For list

Re: InnoDB Indices

2006-03-09 Thread Heikki Tuuri
- From: ""Robert DiFalco"" <[EMAIL PROTECTED]> Newsgroups: mailing.database.myodbc Sent: Thursday, March 09, 2006 8:41 PM Subject: RE: InnoDB Indices =20 ++ I can't see it helping with insert, but depending on the where clause on your updates and deletes it could.

RE: InnoDB Indices

2006-03-09 Thread Robert DiFalco
make deletes faster. But every database engine handles this stuff differently. R -Original Message- From: David Turner [mailto:[EMAIL PROTECTED] Sent: Thursday, March 09, 2006 10:13 AM To: Robert DiFalco; mysql@lists.mysql.com Subject: Re: InnoDB Indices - Original Message

Re: InnoDB Indices

2006-03-09 Thread David Turner
- Original Message From: Robert DiFalco <[EMAIL PROTECTED]> To: mysql@lists.mysql.com Sent: Thursday, March 9, 2006 9:32:44 AM Subject: InnoDB Indices I have some questions regarding InnoDB indices. Say I have a table with millions of records. On of the fields is a type fiel

Re: InnoDB Indices

2006-03-09 Thread SGreen
"Robert DiFalco" <[EMAIL PROTECTED]> wrote on 03/09/2006 12:32:44 PM: > I have some questions regarding InnoDB indices. > > Say I have a table with millions of records. On of the fields is a type > field that has a possible value of 1,2,3, or 4. I sometimes query by

InnoDB Indices

2006-03-09 Thread Robert DiFalco
I have some questions regarding InnoDB indices. Say I have a table with millions of records. On of the fields is a type field that has a possible value of 1,2,3, or 4. I sometimes query by the type field and may at other times order on it. Do queries benefit from an index with this low of a

Re: How to avoid redundancy between PK and indices ?

2005-10-06 Thread Hank
now what it is now, though, and have (or already have) considered adding support for it in MySQL. -Hank On 10/5/05, C.R. Vegelin <[EMAIL PROTECTED]> wrote: > Hi Hank, > You are quite right. > I need separate non-unique indices on a, b, c, d, e and f to avoid table > scans. > An

Re: How to avoid redundancy between PK and indices ?

2005-10-05 Thread C.R. Vegelin
Hi Hank, You are quite right. I need separate non-unique indices on a, b, c, d, e and f to avoid table scans. And when each combi must be unique I need a Primary Key (a,b,c,d,e,f). And only Key a (a) seems to be redundant with the primary key ... Suppose there would be a PK (a,b,c,d,e,f

Re: How to avoid redundancy between PK and indices ?

2005-10-05 Thread Hank
It depends.. if this is your create table statement: CREATE TABLE foo ( a smallint NOT NULL, b smallint NOT NULL, c smallint NOT NULL, d smallint NOT NULL, e smallint NOT NULL, f smallint NOT NULL, PRIMARY KEY (a,b,c,d,e,f) ); Then only one unique index is being created on the conc

Re: How to avoid redundancy between PK and indices ?

2005-10-04 Thread Alec . Cawley
insert would have to include a full table scan. Alec "C.R. Vegelin" <[EMAIL PROTECTED]> 04/10/2005 15:10 To cc Subject Re: How to avoid redundancy between PK and indices ? Hi Alec, Thanks for your comment. Well, we disagree on a few points. Suppose I h

Re: How to avoid redundancy between PK and indices ?

2005-10-04 Thread C.R. Vegelin
s etc. So I need 4 separate indices, where CountryId may occur more than once in the CountryId index, CompanyID may occur more than once in the CompanyID index etc. But if these 4 columns together are defined as Primary Key, then each combi of CountryID, CompanyID, SectorID and ProductID is uniqu

Re: How to avoid redundancy between PK and indices ?

2005-10-04 Thread Alec . Cawley
"C.R. Vegelin" <[EMAIL PROTECTED]> wrote on 04/10/2005 12:52:01: > Hi List, > > Is anyone familiar with optimizing indices, including primary key ? > I do have a large myisam table with 6 non-unique key fields, lets > say named A, B, C, D, E and F. > Each

How to avoid redundancy between PK and indices ?

2005-10-04 Thread C.R. Vegelin
Hi List, Is anyone familiar with optimizing indices, including primary key ? I do have a large myisam table with 6 non-unique key fields, lets say named A, B, C, D, E and F. Each of these columns may have NOT NULL values from 0 to 999, and are defined as SmallInt. Requirement: each row must

Re: Question on Indices

2005-07-14 Thread Gleb Paharenko
L PROTECTED]> wrote: > Greetings, >I am trying to get a feel of how MySQL would handle certain types of > situation, mainly concerning the usage of indices. > >Say I have two exactly identical table structures namely table A & B. > >For table A, I just

Re: Question on Indices

2005-07-14 Thread SGreen
Manoj <[EMAIL PROTECTED]> wrote on 07/14/2005 06:09:24 AM: > Greetings, > I am trying to get a feel of how MySQL would handle certain types of > situation, mainly concerning the usage of indices. > > Say I have two exactly identical table structures namely table

Question on Indices

2005-07-14 Thread Manoj
Greetings, I am trying to get a feel of how MySQL would handle certain types of situation, mainly concerning the usage of indices. Say I have two exactly identical table structures namely table A & B. For table A, I just have one composite primary key on (Code, Date1 &am

Question on Indices

2005-07-14 Thread ManojW
Greetings, I am trying to get a feel of how MySQL would handle certain types of situation, mainly concerning the usage of indices. Say I have two exactly identical table structures namely table A & B. For table A, I just have one composite primary key on (Code, Date1 &am

Re: Indices and Constraints.

2004-12-02 Thread SGreen
ank you. But I want select the constraints and indices used on the > > table. How can we get this information?. Please help me in this. > > Ian gave you the answer: > > > From: Ian Sales > [...] > > - show indexes from DATABASE_NAME.TABLE_NAME > > The synt

Re: Indices and Constraints.

2004-12-02 Thread Roger Baklund
[EMAIL PROTECTED] wrote: Hi, Thank you. But I want select the constraints and indices used on the table. How can we get this information?. Please help me in this. Ian gave you the answer: From: Ian Sales [...] - show indexes from DATABASE_NAME.TABLE_NAME The syntax is: SHOW INDEX FROM

RE: Indices and Constraints.

2004-12-02 Thread lakshmi.narasimharao
Hi, Thank you. But I want select the constraints and indices used on the table. How can we get this information?. Please help me in this. Thanks, Narasimha -Original Message- From: Ian Sales [mailto:[EMAIL PROTECTED] Sent: Thursday, December 02, 2004 5:07 PM To: Lakshmi NarasimhaRao

Re: Indices and Constraints.

2004-12-02 Thread Ian Sales
[EMAIL PROTECTED] wrote: Need to know the similar one in MySQL. Do we have views or any other system tables in MySQL 4.0.21 which OUTPUTS the constraints and indices in a particular table? - show indexes from DATABASE_NAME.TABLE_NAME - or, show create table DATABASE_NAME.TABLE_NAME; - ian

Re: Indices and Constraints.

2004-12-02 Thread electroteque
Thats usually setup in the same table schema no ? On 02/12/2004, at 9:52 PM, <[EMAIL PROTECTED]> wrote: Hi All, In oracle I can query user_constraints, user_indexes for getting the constraints and indices for a particular table. User_constraints and user_idexes are view which holds a

Indices and Constraints.

2004-12-02 Thread lakshmi.narasimharao
Hi All, In oracle I can query user_constraints, user_indexes for getting the constraints and indices for a particular table. User_constraints and user_idexes are view which holds all the constraints and indices for a particular table. Need to know the similar one in MySQL. Do we have views

Re: fulltext indices

2004-03-25 Thread Brent Baisley
First, full text indices have nothing to do with importing the data, it's just a special type of indexing for searching. The reason you got several rows is that you probably did not specify delimiters. Thus, every time a return was encountered, a new record was created because return i

Re: fulltext indices

2004-03-25 Thread Kurt Haegeman
Brandon Carter wrote: Is it possible to fit an entire article (say, a newspaper article) into one cell of a MySQL database? When I tried load data local infile the file was imported into several rows! Perhaps I just don't understand the use of a fulltext index. --bhcesl Do you Yahoo!? Yahoo! F

fulltext indices

2004-03-25 Thread Brandon Carter
Is it possible to fit an entire article (say, a newspaper article) into one cell of a MySQL database? When I tried load data local infile the file was imported into several rows! Perhaps I just don't understand the use of a fulltext index. --bhcesl Do you Yahoo!? Yahoo! Finance Tax Center -

Why do indices crash

2003-10-28 Thread plutoplanet
Hi can anybody tell me the most common reason WHY an index file get's corrupted? I have tested this on differernt versions of MySQL (3.23.37 - 4.1) on Linux and on Windows. It happens on tables containing A MEDIUMTEXT or LONGTEXT column, A fulltext index on these columns I am mostly work

re: Indices in querys using OR...

2003-03-18 Thread Egor Egorov
On Tuesday 18 March 2003 02:47, dreq jkj wrote: > I have trouble figuring out how the indices are used when making a query > that uses OR-operator. > > If I have the following table: > > create table testing( > id int unsigned not null primary key auto_increment, > id

Indices in querys using OR...

2003-03-17 Thread dreq jkj
I have trouble figuring out how the indices are used when making a query that uses OR-operator. If I have the following table: create table testing( id int unsigned not null primary key auto_increment, idx1 int unsigned not null, idx2 int unsigned not null, index(idx1), index(idx2)); In this

re: Indices do not seem to work for OR queries

2003-03-03 Thread Egor Egorov
l1,email2 | NULL |NULL | NULL | 57051 | Using > > where | > ++--+---+--+-+--+---+-- >---+ [skip] > I'm curious why this is. (In general, I have been surprised by how often > indices are not used even if they exist.) it's know behaviour and descr

Indices do not seem to work for OR queries

2003-02-28 Thread Henning Schulzrinne
--+--+-+ | person | ref | email1,email2 | email1 | 101 | const |1 | Using where | ++--+---++-+---+--+-+ I'm curious why this is. (In general, I have been surprised by how often indices are no

Re: Performance whil Building Indices -- how does it scale?

2002-09-25 Thread Chris Stoughton
>> >>Very nice to know that adding an index forces a rebuild of all indices! >>(Side note -- I was going to configure the database with a minimal set >>of indices, and then watch to see how people use the database, and then >>add indices on popular columns.) >>

Re: Performance whil Building Indices -- how does it scale?

2002-09-24 Thread Jeremy Zawodny
On Mon, Sep 23, 2002 at 07:25:17AM -0500, Chris Stoughton wrote: > Joseph, > > Thanks for the quick answer. > > Very nice to know that adding an index forces a rebuild of all indices! > (Side note -- I was going to configure the database with a minimal set > of indices,

Re: Performance whil Building Indices -- how does it scale?

2002-09-23 Thread Chris Stoughton
Joseph, Thanks for the quick answer. Very nice to know that adding an index forces a rebuild of all indices! (Side note -- I was going to configure the database with a minimal set of indices, and then watch to see how people use the database, and then add indices on popular columns.) I did

Re: Performance while Building Indices -- how does it scale?

2002-09-23 Thread Joseph Bueno
is a "small" prototype for > the actual database, which will have 40 times more rows. > > I used two strategies to create these tables: > > 1. Create the indices in the "create table" statement > 2. Load the table, and then use the "create index&

Performance while Building Indices -- how does it scale?

2002-09-22 Thread Chris Stoughton
the actual database, which will have 40 times more rows. I used two strategies to create these tables: 1. Create the indices in the "create table" statement 2. Load the table, and then use the "create index" statement for each index. With Strategy 1, the loading started nicely

Re: Affecting weighting of fulltext indices

2002-07-03 Thread Scott Gifford
times when creating the index. For example: create fulltext index test on TxKeywords (Title,Title,Description); seems to have roughly the desired effect, but I don't exactly understand what it's doing, and I don't know if this is supported behavior, or if might go

Re[2]: innodb and use of indices

2001-11-26 Thread Peter Zaitsev
Hello Heikki, Wednesday, November 21, 2001, 8:34:13 PM, you wrote: I see some more users are interested in optimize table to work. Why don't you just map OPTIMIZE TABLE to ALTER TABLE for INNODB tables so user may not care about table type, there currently one should check the table type and use

Re: innodb and use of indices

2001-11-21 Thread Heikki Tuuri
Hi! >On Wed, 2001-11-21 at 05:19, Heikki Tuuri wrote: >> The way to defragment InnoDB tables, or tables in any database, is from time >> to time to dump and reimport them. That can give a significant performance >> boost. >> > >That is actually not entirely true. For MyISAM tables, one simply n

Re: innodb and use of indices

2001-11-21 Thread Steve Meyers
On Wed, 2001-11-21 at 05:19, Heikki Tuuri wrote: > The way to defragment InnoDB tables, or tables in any database, is from time > to time to dump and reimport them. That can give a significant performance > boost. > That is actually not entirely true. For MyISAM tables, one simply needs to run

Re: innodb and use of indices

2001-11-21 Thread Heikki Tuuri
and reimport them. That can give a significant performance boost. Regards, Heikki -Original Message- From: nsabbi <[EMAIL PROTECTED]> To: Heikki Tuuri <[EMAIL PROTECTED]> Cc: [EMAIL PROTECTED] <[EMAIL PROTECTED]> Date: Wednesday, November 21, 2001 11:37 AM Subject: inno

innodb and use of indices

2001-11-20 Thread nsabbi
HI, I have two problems: 1) I have the following table: desc users; +--+--+--+-+-+---+ | Field| Type | Null | Key | Default | Extra | +--+--+--+-+-+---+ | username | varchar(128) | | PRI |

Re: Indices

2001-08-21 Thread Rene Tegel
On Tue, 21 Aug 2001 18:55:15 +0400 Spirit <[EMAIL PROTECTED]> wrote: > Hello! > > I need your suggestions on what keys to build for the table described > below. Currently I have almost all possible keys on the table in order > to see what keys mysql will use. > > I have a table here, which cons

Indices

2001-08-21 Thread Spirit
Hello! I need your suggestions on what keys to build for the table described below. Currently I have almost all possible keys on the table in order to see what keys mysql will use. I have a table here, which consist of over 6 million records by now and is defined as follows: CREATE TABLE traffi

Insert values in tables with indices

2001-08-17 Thread Guddack Thorsten ICM MP SCM SCCM PI
Hi List, I've a question about inserting values in tables with promary-keys. I have two tables: 1. Table ( contains limits for testing ) - int limitId primary key - int lowerlimit - int upperlimit - char(5) measureunit - char(10) measurename 2. Table ( contains measured values ) - int measureid

recreate indices from .frm and .MYD

2001-04-03 Thread Balazs Bogdan
hello mysql; how can I recreate indices from .frm and .MYD? laplace:/mnt/bigboy/mysql/newage# /usr/local/mysql/bin/myisamchk -rv USR_User.MYD /usr/local/mysql/bin/myisamchk: error: 'USR_User.MYD' doesn't have a correct index definition. You need to recreate it before you can d

CREATE TABLE xyz SELECT FROM... does not create indices - is this a bug?

2001-03-18 Thread Peter Holm
Hi, you may know the feature create table xyz select * from xy... which is similar to oracles select into table. It works ok, only thing is that with this statement no indices are created on the new table. Is this a bug? Have a nice thread, Peter