Re: Indexing Questions (Problem?)

2005-02-04 Thread Brad Guillory
Thanks Tom and Michael, I got rid of all of the indexes except the one marked "PRIMARY" and a new one that I made like this: ALTER TABLE logs ADD unique (host,date,time,priority,facility,seq); I see quite an improvement from what I was seeing before. The one thing that I didn't realize is that

RE: Indexing Questions (Problem?)

2005-02-03 Thread Tom Crimmins
> >>Do I need to make a special index to index time on HOUR? > Is it even > >>possible? > > > > I believe the index on time will work for this. > > No, it won't. At least, not with the query as is: > >SELECT * FROM logs >WHERE host IN ('10.20.254.5') > AND date='2005-02-03' >

Re: Indexing Questions (Problem?)

2005-02-03 Thread Michael Stassen
Tom Crimmins wrote: -Original Message- From: Brad Guillory Sent: Thursday, February 03, 2005 18:15 mysql> EXPLAIN SELECT * FROM logs WHERE host in ('10.20.254.5') and date='2005-02-03' and HOUR(time) between '16' and '17' ORDER BY seq DESC; ALTER TABLE logs ADD unique (host,dat

RE: Indexing Questions (Problem?)

2005-02-03 Thread Tom Crimmins
> -Original Message- > From: Brad Guillory > Sent: Thursday, February 03, 2005 18:15 > > Please be gentle, I have nearly no experience with SQL > databases. I am > not subscribed to the list so please cc me on replies. > > Because my email client probably did horrable things to this

Indexing Questions (Problem?)

2005-02-03 Thread Brad Guillory
Please be gentle, I have nearly no experience with SQL databases. I am not subscribed to the list so please cc me on replies. Because my email client probably did horrable things to this post you can find the text here also: http://nolab.org/scratch/mysql-index-oddness.html I use syslog-ng t

Re: Two indexing questions

2004-02-27 Thread Sasha Pachev
Marc Slemko wrote: On Thu, 26 Feb 2004, Keith Thompson wrote: Given these two tables: create table t1 ( id int unsigned auto_increment, a int, ... [other fields] primary key (id), index aid (a,id) ) type=innodb; create table t2 ( id int unsigned,

Two indexing questions

2004-02-26 Thread Keith Thompson
Given these two tables: create table t1 ( id int unsigned auto_increment, a int, ... [other fields] primary key (id), index aid (a,id) ) type=innodb; create table t2 ( id int unsigned, b int, ... [other fields] index id (i

Re: Two indexing questions

2004-02-26 Thread Marc Slemko
On Thu, 26 Feb 2004, Keith Thompson wrote: > Given these two tables: > > create table t1 ( >id int unsigned auto_increment, >a int, >... [other fields] >primary key (id), >index aid (a,id) > ) type=innodb; > > create table t2 ( >id int un

Re: InnoDB indexing questions

2002-10-13 Thread Heikki Tuuri
Lourdes, - Original Message - From: <[EMAIL PROTECTED]> Newsgroups: mailing.database.mysql Sent: Friday, October 11, 2002 11:38 PM Subject: InnoDB indexing questions > Hello, > > I have some doubts about the index behaviour in InnoDB. > > I have a table n

InnoDB indexing questions

2002-10-11 Thread rafarife
Hello, I have some doubts about the index behaviour in InnoDB. I have a table named 'Albaranes'. The definition is as follow: CREATE TABLE `albaranes` ( `Cli` varchar(6) NOT NULL default '', `Alb` varchar(8) NOT NULL default '', . . . PRIMARY KEY (`Alb`), UNIQUE KEY `Cliente` (`

Indexing questions

2002-10-11 Thread rafarife
Hello, I have some doubts about the index behaviour in InnoDB. I have a table named 'Albaranes'. The definition is as follow: CREATE TABLE `albaranes` ( `Cli` varchar(6) NOT NULL default '', `Alb` varchar(8) NOT NULL default '', . . . PRIMARY KEY (`Alb`), UNIQUE KEY `Cliente` (`