Re: Slow query using between

2006-05-05 Thread Dan Buettner
Good morning James - It looks like you have a multi-column index on the startIpNum and endIpNum columns, but it's not doing you any good, at least not for this query. You don't mention how many rows of data you're searching against, which would give a better idea as to what might be reasonab

Slow query using between

2006-05-04 Thread James Riordon
Hello, I am running Ver 14.7 Distrib 4.1.12, for redhat-linux-gnu (i386) using readline 4.3 on a Dual Xeon 2.4Ghz RHEL4 box with 4GB of RAM. I have a query that takes anywhere from .25 - .85 seconds to run. Following are the query and the related table structures I have currently set up

Re: using between

2005-03-26 Thread Jigal van Hemert
From: "Rob Brooks" > Well, we have this db with various ip address ranges and the country of > origin associated with each ... the format is: > > countryOfOrigin FromIP ToIP > --- -- > US some lower bound some upper bound > Canada some lower bound some upper bound > Etc... >

RE: using between

2005-03-25 Thread Matt Babineau
, 2005 1:05 PM To: 'mos'; 'MySQL list' Subject: RE: using between Well, we have this db with various ip address ranges and the country of origin associated with each ... the format is: countryOfOrigin FromIP ToIP --- ---

RE: using between

2005-03-25 Thread Rob Brooks
To: MySQL list Subject: Re: using between At 01:48 PM 3/25/2005, you wrote: >Hello > >Is there a way when searching for a range of values for a particular field >that mysql would not have to look at the entire table ... I'm guessing with >some type of composite key or something

Re: using between

2005-03-25 Thread mos
At 01:48 PM 3/25/2005, you wrote: Hello Is there a way when searching for a range of values for a particular field that mysql would not have to look at the entire table ... I'm guessing with some type of composite key or something? ... e.g. SELECT aField FROM aDatabase WHERE aVariable BETWEEN field

using between

2005-03-25 Thread Rob Brooks
Hello Is there a way when searching for a range of values for a particular field that mysql would not have to look at the entire table ... I'm guessing with some type of composite key or something? ... e.g. SELECT aField FROM aDatabase WHERE aVariable BETWEEN field1 AND field2; Field1 and field

Re: Using BETWEEN or <= >=

2004-01-14 Thread Rory McKinley
On 13 Jan 2004 at 10:11, Eve Atley wrote: > > I am attempting to construct a select statement in which I can find values > between two fields: start, and end. I have tried using "BETWEEN" and > comparing with <= and >=, but neither meet success. Can someone pleas

RE: Using BETWEEN or <= >=

2004-01-13 Thread Mike Johnson
From: Eve Atley [mailto:[EMAIL PROTECTED] > I am attempting to construct a select statement in which I > can find values between two fields: start, and end. I have > tried using "BETWEEN" and comparing with <= and >=, but > neither meet success. Can someone please

Using BETWEEN or <= >=

2004-01-13 Thread Eve Atley
I am attempting to construct a select statement in which I can find values between two fields: start, and end. I have tried using "BETWEEN" and comparing with <= and >=, but neither meet success. Can someone please set me straight? This is meant to be in a PHP page, but I'm a

How to select records based on timestamp field (using BETWEEN and AND sql clause

2003-11-18 Thread wu hai
I have a table with one timestamp field named "timedate" (Unix_timestamp format). I used the follow command but it's not working correctly: mysql> select count(*) from tablename where date_format(timedate,"%Y-%m-%d") between date_sub(now(), interval 1 DAY) and now(); Empty Set This result is no