2014/06/20 11:31 +0100, Neil Tompkins
I'm using MySQL 5.6.17 on Amazon Web Services RDS and when calling SELECT
UUID_SHORT() I'm getting a number bigger than 9223372036854775807. For
example the number I get is
12057145185130250250
help uuid_short
Name: 'UUID_SHORT'
Descriptio
g a number 12057145185130250250 I get the error MySQL 22003
'MySQL 22003 Out of range value for column '' at row 1'
If I run SELECT UUID_SHORT() on our test server which is MySQL 5.6.11
(running on Windows 2008 64x) the result is as follows;
23526798209843216
I changed the colum
Thanks, It worked :)
On Mon, May 10, 2010 at 6:25 PM, Jay Ess wrote:
> On 2010-05-09 13:29, Prabhat Kumar wrote:
>
>> INSERT INTO myTable_info (id,range, total_qt, qt_correct, finish_time,
>> username, datestamp) VALUES (NULL,'Kumar', '20
On 2010-05-09 13:29, Prabhat Kumar wrote:
INSERT INTO myTable_info (id,range, total_qt, qt_correct, finish_time,
username, datestamp) VALUES (NULL,'Kumar', '20', '17', '111', 'Prabhat','*
NOW()');*
Last_SQL_Error: Error 'You have
of mysql.
Master :5.0.67-log
Slave : 5.1.43sp1-enterprise-gpl-advanced-log
There is table:
CREATE TABLE `myTable_info` (
`id` int(11) NOT NULL auto_increment,
`range` varchar(255) NOT NULL,
`total_qt` smallint NOT NULL default '0',
`qt_correct` smallint NOT NULL
Hi,
I have setup replication between 2 servers, on both there is different
versions of mysql.
Master :5.0.67-log
Slave : 5.1.43sp1-enterprise-gpl-advanced-log
There is table:
CREATE TABLE `myTable_info` (
`id` int(11) NOT NULL auto_increment,
`range` varchar(255) NOT NULL,
`total_qt
WHERE 70 BETWEEN start_sequence AND end_sequence
AND 'C' BETWEEN start_batch AND end_batch;
Though what you should really do is add a unique auto increment to every
symbol, then you only have to do a simple range check.
Or use a full relational structure and have a OTM or MTM with
Hi
My stock serial number format is 1A - 9A, 1B - 9B ... 1Z
- 9Z.
These stocks are check in to warehouse in different order, so the worker may
check in the stocks like
1A - 00100A
9B - 00010C
00051B - 00070B
I have a table to keep track the stock check in transa
|
>> ++-----+---+---+---+--+-+--+
>> ---+-+
>> | 1 | SIMPLE | log | range | date | date | 4 |
>> NULL
>> | 45178 | Using where |
>> +----+-----+---+---+-
ey | key_len | ref
| rows | Extra |
++-+---+---+---+--+-+--+
---+-+
| 1 | SIMPLE | log | range | date | date | 4 | NULL
| 45178 | Using where |
++-+---+---+---+--+-+--+
---+-+
As you
ct_type | table | type | possible_keys | key | key_len | ref
> | rows | Extra |
>
> ++-+---+---+---+--+-+--+
> ---+-+
> | 1 | SIMPLE | log | range | date | date | 4 | NULL
> | 45178 | Using where |
>
> ++
ey | key_len | ref
| rows | Extra |
++-+---+---+---+--+-+--+
---+-+
| 1 | SIMPLE | log | range | date | date | 4 | NULL
| 45178 | Using where |
++-+---+---+---+--+-+--+
---+-+
As you can see in the ab
David Perron schrieb:
Hi Sebastian-
Wanted to follow up on this. I figured out the problem. You actually
have to use the LEAST & GREATEST operators when comparing multiple
values, this statement works perfectly.
LEAST(EndDays,Q2EndDays) - GREATEST(Q2StartDays,StartDays) as DaysInQ2,
Thank
David Perron schrieb:
Hello Users-
I think I have an interesting question with regards to applying a function
to date range, I think half of problem solving is explaining it to an
audience so please, bear with me.
There is a table Orders that has two DATE columns, StartDate and EndDate.
The
Hello Users-
I think I have an interesting question with regards to applying a function
to date range, I think half of problem solving is explaining it to an
audience so please, bear with me.
There is a table Orders that has two DATE columns, StartDate and EndDate.
The range of dates can vary
| NULL|
+--+-+--+-+-++
If I only enter a new movie title, leaving the rest of the fields blank,
my script throws an error:
Out of range value adjusted for column 'Year' at row 1
My Perl code for the above action:
my $
> I have a report that contains a WHERE statement to report on a date
range in
> Pentaho.
>
> WHERE
> InOut.MOVEMENTDATE >= (CURRENT_DATE - 7)
>
> I want to show on the report what the first date of this range is. Can
> someone help me with this statement? So if the
I have a report that contains a WHERE statement to report on a date range in
Pentaho.
WHERE
InOut.MOVEMENTDATE >= (CURRENT_DATE - 7)
I want to show on the report what the first date of this range is. Can
someone help me with this statement? So if the last seven days is January
24, 2008
ndition (or two intervals if <> or != is used).
>
> especially the second sentence :
>
> An interval can be used as long as it is possible to determine a single key
> tuple containing all records that match the condition (or two intervals if <>
> or != is used).
>
n be used as long as it is possible to determine a single key
tuple containing all records that match the condition (or two intervals if <>
or != is used).
(7.2.5.2. Range Access Method for Multiple-Part Indexes in the manual of mysql)
the example showed in the manual is :
key_part1 = &
Chris,
What I want to do is find all the groups where the inserts all
happened with in say 10 seconds. So my group by would be more like..
Perhaps the easiest solution is to make a temp table of datetime ranges
from the resultset, then join from and group by those rowIDs.
PB
-
Chr
Hi,
Chris W wrote:
I have the following query...
SELECT CreateDate, count( * )
FROM `userprofile`
GROUP BY CreateDate
It isn't exactly what I want. Records are added to this table in 2 main
ways. First people use the web site interface to create records. In
this case, records are only added
I have the following query...
SELECT CreateDate, count( * )
FROM `userprofile`
GROUP BY CreateDate
It isn't exactly what I want. Records are added to this table in 2 main
ways. First people use the web site interface to create records. In
this case, records are only added by one or 2 people a
You could use triggers to check for sane values on fields and rollback
if not sane.
http://dev.mysql.com/doc/refman/5.0/en/triggers.html
You'd need to handle the rollback in your frontend app.
Dan
On 12/8/06, Christian High <[EMAIL PROTECTED]> wrote:
Is it possible to restrict the
Is it possible to restrict the range that can be put in a floating point, or
other data type that allows decimal numbers. The data being stored will be
that of the result of chemical analysis. The result could very well be
2.41however it would never be
24.1 so i want to ensure that a simple typo
y first two where statements; r has 6 unique
series, p has multiple programmes and s has multiple speakers
I'm trying to pick out the latest programme in each series in a date range and
include the series full name (prog_name) and speaker full name (spk_name) from
the other tables.
I'
where statements; r has 6 unique
series, p has multiple programmes and s has multiple speakers
I'm trying to pick out the latest programme in each series in a date range and
include the series full name (prog_name) and speaker full name (spk_name) from
the other tables.
I've played arou
an try this:
SELECT DISTINCT lastname FROM employee WHERE lastname BETWEEN 'm' AND 'z';
Thanks,
ViSolve DB Team.
- Original Message - From: "Paul Nowosielski"
<[EMAIL PROTECTED]>
To:
Sent: Friday, July 21, 2006 10:33 PM
Subject: Searching through an alpha
t: Searching through an alphabetical range
Dear All,
I need to write a query that searches last names between the ranges of m
through z.
Is there a way to do this in the query?
Thank You,
--
Paul Nowosielski
Webmaster
office: 303.440.0666 ext 219
cel: 303.827.4257
--
MySQL General
im Lucia
Subject: Re: Searching through an alphabetical range
Its working fine for me:
mysql> SELECT DISTINCT email_address FROM mailing_list WHERE marketing_list
LIKE 'Y' AND last_name >= 'm' AND last_name <= 'z';
26371 rows in set (1.00 sec)
Thank You,
--
Paul
+-+
>
> | 'seal' >= 'm' AND 'seal' <= 'z' |
>
> +-+
>
> | 1 |
>
> +-+
> 1 row in set (0.00 sec)
>
> mysql>
>
> '
--+
| 1 |
+-+
1 row in set (0.00 sec)
mysql>
'zz' will probably do the trick, though.
Tim
> -Original Message-
> From: Paul Nowosielski [mailto:[
I have the solution:
SELECT DISTINCT email_address FROM mailing_list WHERE last_name >= 'm' AND
last_name <= 'z'
Thank you,
--
Paul Nowosielski
Webmaster
On Friday 21 July 2006 11:03, Paul Nowosielski wrote:
> Dear All,
>
> I need to write a query that searches last names between the range
Dear All,
I need to write a query that searches last names between the ranges of m
through z.
Is there a way to do this in the query?
Thank You,
--
Paul Nowosielski
Webmaster
office: 303.440.0666 ext 219
cel: 303.827.4257
--
MySQL General Mailing List
For list archives: http://lists.mysql
looks like:
*** 1. row ***
id: 1
select_type: SIMPLE
table: cwGroup
type: range
possible_keys: quotation_id,stripped_cw
key: stripped_cw
key_len: 101
ref: NULL
rows: 8489
Extra: Using wh
Is there any way to optimize a range query that includes
an ORDER BY with keys from two different tables? I'm running
MySQL 4.1.18 on FreeBSD.
I've been struggling with some queries that are _incredibly_
slow--from 1-5 minutes on slowish but decent hardware. When I
try versions without
Well, I hadn't known about the spatial features of MySQL. If you're ok
using vendor extensions then that definitely looks like the way to go:
http://dev.mysql.com/doc/refman/5.0/en/gis-introduction.html
A
On Apr 24, Nick Hill wrote:
> Hello Adam
>
> Adam Wolff wrote:
> > Actually runs through
Hello Adam
Adam Wolff wrote:
Actually runs through the table four times instead of twice, and maybe
can't even use the index for the whole query.
Assuming my results are not typical of MySQL query times, this would
explain the sqrt() relationship of returned rows to query time.
I have tried
current large data sets if data will be spread across different
physical drives, but not with regular range lookups that you're
doing). It will only help with inserts.
Assuming even distribution, selecting a table amongst 1000 will only
take a few ms while 2^log10(1000) gives an 8 fold improvem
ll (well, it may help on scans with
concurrent large data sets if data will be spread across different
physical drives, but not with regular range lookups that you're
doing). It will only help with inserts.
> Given that there is such a strong relationship between the number of
> records
returned. If all records we are
> > matching
> > are under a single node or under a small number of nodes in the index tree,
> > perhaps there is some way of telling the database engine to ignore the rest
> > of
> > the index tree.
> >
> > Could this work, o
ex tree,
> perhaps there is some way of telling the database engine to ignore the rest of
> the index tree.
>
> Could this work, or am I misunderstanding how the index tree works? Are there
> existing optimisations which can de-couple the relationship between number of
> records and que
electing are within a small range?
Background information:
We can boil all this down to a mathematical relationship where
query1 selects s number of records from r records dataset
and
query2 selects b number of records from c records dataset
Tquery1 is time to execue query 1 and Tquery2 is tim
Paul,
If there are no data for a particular day, it is not included. Is
there a way to include all days even if the result is 0? I saw an
example that included another table with all dates and an inner join
but that seems a little clunky.
In SQL, enumerating data you don't have requires some
Database software is not a calendar. The data you put in is the data
you get out. If the day is never put in, you'll never get it out.
You need to have some data source that has all the days in it, like an
external table, if you want to be able to retrieve that data.
Otherwise, you could do it
I have the following query:
select count(*) as cnt, date(timestamp) as day from table where
date_sub(curdate(),interval 14 day) <= timestamp group by day;
If there are no data for a particular day, it is not included. Is
there a way to include all days even if the result is 0? I saw an
example th
,'19990731','\"Orig Bill
> £728.50\"',364.68,'A',17.50);
>
> The table columns are set to
> char(12),date,char(1),date,char(40),decimal(12,2),char(1),decimal(3,2). The
> table is MyISAM.
>
> There error produced on the pure version 5 in
iption,BillAmount,VatCode,
> VatRate)
> VALUES
> ('1234#6','19991016','C','19990731','\"Orig Bill
> £728.50\"',364.68,'A',17.50);
>
> The table columns are set to
> char(12),date,char(1),date,char(40),decima
27;A',17.50);
The table columns are set to
char(12),date,char(1),date,char(40),decimal(12,2),char(1),decimal(3,2). The
table is MyISAM.
There error produced on the pure version 5 installation is:
"Out of Range value adjusted for column VATRate at row 1"
and then quits. I have let th
To: mysql@lists.mysql.com
Subject: Changing range of identity column for future inserts
Date: Tue, 15 Nov 2005 08:50:03 -0600
I would like to change one of my tables so that future inserts use
a higher range of numbers for the primary key values.
I have a table 'event' with column:
id i
mel list_php wrote:
From: Dan Buettner <[EMAIL PROTECTED]>
To: mysql@lists.mysql.com
Subject: Changing range of identity column for future inserts
Date: Tue, 15 Nov 2005 08:50:03 -0600
I would like to change one of my tables so that future inserts use a
higher range of numbers for the p
,
melanie
From: Dan Buettner <[EMAIL PROTECTED]>
To: mysql@lists.mysql.com
Subject: Changing range of identity column for future inserts
Date: Tue, 15 Nov 2005 08:50:03 -0600
I would like to change one of my tables so that future inserts use a higher
range of numbers for the primary key value
I would like to change one of my tables so that future inserts use a
higher range of numbers for the primary key values.
I have a table 'event' with column:
id int unsigned not null auto_increment primary key
Currently new records are going into the table with id column valu
Is the DATE field a timestamp column?
What's your schema? What's your primary key?
I ask this because the real question is, "is it safe to assume that
new entries are for the current day it is inserted?"
If the answer to that question is yes, you can use an id field (or an
existing one) to find
OK.
I need help with the following query:
SELECT * FROM PRODUCT WHERE DATE > ? ORDER BY PRICE;
Basically find products created since a given date and order by prices.
I could put an index of DATE, PRICE but it will have to resort to a
filesort since DATE isn't a constant value.
I was thin
James,
>I need to figure out how many Tuesdays are contained
>within 1/1/2004 - 5/1/2004, and I need to come up with
>a result where I know how many of each day of the week
>is within that date range.
Supposing a table named tbl and datetime columns named d1 and d2,
something li
Tuesdays are contained
within 1/1/2004 - 5/1/2004, and I need to come up with a result where I
know how many of each day of the week is within that date range.
I am hoping someone may have a solution, as, once I know the number of
Tues then I can state the average number of sessions on a Tuesday at
Brian Menke wrote:
Hi everyone, I've always had a challenge working with dates. I'm
building an app that needs to query a range of dates. I'm using ASP
(for the first time, I usually write in Java). Anyway my date column
uses the -00-00 format, which I think is the default
Hi everyone, I've always had a challenge working with dates. I'm building an
app that needs to query a range of dates. I'm using ASP (for the first time,
I usually write in Java). Anyway my date column uses the -00-00 format,
which I think is the default format? Is it?
I
I have the same issue (missing dates) with my graphing widget, too. I
worked around my problem by using script to create a temp table that
contains all of the dates that cover the range of dates I want to chart
then left join the data tables to my temp table. Sure it's a small memory
load
In article <[EMAIL PROTECTED]>,
Partap Davis <[EMAIL PROTECTED]> writes:
> I'm graphing the data from this query using dates on the x axis. The
> input to my graph module (GD::Graph) requires a constant-length list.
> So if any days in my selection range have no data,
from this query using dates on the x axis. The
input to my graph module (GD::Graph) requires a constant-length list.
So if any days in my selection range have no data, I need to fill the
space with an empy value.
For example, say my date range is '2004-10-01' to '2004-10-05
hello,
I wonder if it is possible to match a word like with instr()
and get as a result just 10 words bevor and ten words after
the matched word. (like google presents the matched query)
I would need a select with a replacement and a fitting where
clause which could be done with isset.
I have is
- Original Message -
From: <[EMAIL PROTECTED]>
To: "Dirk Bremer (NISC)" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Monday, September 27, 2004 14:30
Subject: Re: Date Range
> I think you are very close but you are missing the LAST day of each mont
er \(NISC\)" <[EMAIL PROTECTED]> wrote on 09/27/2004 03:18:46
PM:
> - Original Message -
> From: <[EMAIL PROTECTED]>
> To: "Dirk Bremer (NISC)" <[EMAIL PROTECTED]>
> Cc: <[EMAIL PROTECTED]>
> Sent: Monday, September 27, 2004 11:40
> S
- Original Message -
From: <[EMAIL PROTECTED]>
To: "Dirk Bremer (NISC)" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Monday, September 27, 2004 11:40
Subject: Re: Date Range
> To compute the date range for "two months ago". (if the curre
ROTECTED]>
>Cc: <[EMAIL PROTECTED]>
>Sent: Monday, September 27, 2004 11:40
>Subject: Re: Date Range
>
>
>> I see that you are on 4.0.18 so you can't use many of the new date
>> functions (4.1.1+) but has to be an easier way. Let's try thi
At 12:57 -0500 9/27/04, Dirk Bremer (NISC) wrote:
- Original Message -
From: <[EMAIL PROTECTED]>
To: "Dirk Bremer (NISC)" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Monday, September 27, 2004 11:40
Subject: Re: Date Range
I see that you are on 4.0.18
> Whether he needs semicolons depends on which tool he is using to execute
> his statements. If he is using the MySQL client or any of several other
> tools, I agree. If he is going through an ODBC connection, he doesn't need
> them. (At least my 3.52.x drivers can't accept more than one statement
MAIL PROTECTED]>
> >Sent: Monday, September 27, 2004 11:40
> >Subject: Re: Date Range
> >
> >
> >> I see that you are on 4.0.18 so you can't use many of the new date
> >> functions (4.1.1+) but has to be an easier way. Let's try this for
Ah, this is not as complex as I imagined. Thanks!
> -Original Message-
> From: gerald_clark [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, September 22, 2004 4:52 PM
> To: Stembridge, Michael
> Cc: [EMAIL PROTECTED]
> Subject: Re: SELECT a percentage range of a given
SELECT * FROM test
WHERE bpm < ( 100 * 1.08 ) AND bpm > (100*.92)
Stembridge, Michael wrote:
Hello,
I have a music database containing song BPM (Beats Per Minute) data values
stored as FLOAT. I need to pull a range of BPM values based on a
user-supplied integer. The range should pu
At 03:11 PM 9/22/2004, you wrote:
Hello,
I have a music database containing song BPM (Beats Per Minute) data values
stored as FLOAT. I need to pull a range of BPM values based on a
user-supplied integer. The range should pull all records which are 8%
higher and lower than the given integer
Hello,
I have a music database containing song BPM (Beats Per Minute) data values
stored as FLOAT. I need to pull a range of BPM values based on a
user-supplied integer. The range should pull all records which are 8%
higher and lower than the given integer.
I tried this query for
At 16:43 -0700 7/6/04, Scott Haneda wrote:
I can not seem to select a range of timestamp(14) data, something like
Select * from foo where added is in the range of 01/01/2004 to 01/25/2004
Well, one problem might be that 01/01/2004 and 01/25/2004 are not dates...
You should specify your values in
Try BETWEEN
I hope this helps.
Pat...
Patrick Sherrill
CocoNet Corporation
SW Florida's 1st ISP
825 SE 47th Terrace
Cape Coral, FL 33904
- Original Message -
From: "Scott Haneda" <[EMAIL PROTECTED]>
To: "MySql" <[EMAIL PROTECTED]>
Sent: Tuesday,
I can not seem to select a range of timestamp(14) data, something like
Select * from foo where added is in the range of 01/01/2004 to 01/25/2004
--
-
Scott HanedaTel: 415.898.2602
http://www.newgeo.com
| table | type | possible_keys | key | key_len | ref | rows |
Extra|
+---+---+---+--+-+--+--+--
----+
| sali | range | saliDate | saliDate | 8 | NULL | 7
On Wed, May 05, 2004 at 10:53:13AM -0400, Pete McNeil wrote:
> Hello folks,
>
> I'm usinng MySQL 4.0.17.
>
> I have a table something like:
>
> RuleID int,
> GMTBase datetime,
> Credited bigint,
> ...
>
> I have an index built on GMTBase.
> I have rougly 8 million rows.
>
> GMTBase stores a da
ype | possible_keys | key | key_len | ref|
rows | Extra |
+---+---+---+-+-+++-----+
| RuleHistogram | range | GMTBase | GMTBase | 8 | [NUL
I wonder if mysql isn't trying to process
where GMTBase > DATE_SUB(CURRENT_DATE, INTERVAL 2 DAY)
What about doing this date subtracting in PHP and adding the result to the
SQL statement.
> Hello folks,
>
> I'm usinng MySQL 4.0.17.
>
> I have a table something like:
>
> RuleID int,
> GMTBase da
Hello folks,
I'm usinng MySQL 4.0.17.
I have a table something like:
RuleID int,
GMTBase datetime,
Credited bigint,
...
I have an index built on GMTBase.
I have rougly 8 million rows.
GMTBase stores a datetime for the top of the hour on a given date.
I want to build a summary of the last 2 days
inal Message
Subject: Query Range
Date: Mon, 08 Dec 2003 11:23:28 -0600
From: Mike Blezien <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
Organization: Thunder Rain Internet Publishing
To: MySQL List <[EMAIL PROTECTED]>
Hello,
been trying to figure out the correct SQL query
Sorry..
The query should be:
select percentage from table_name where
min >= 500.00 and 500.00 <= max;
database.
Original Message
Subject: Query Range
Date: Mon, 08 Dec 2003 11:23:28 -0600
From: Mike Blezien <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
Organizat
Hello,
been trying to figure out the correct SQL query to get
percentage from a table that list a Min, and Max., price
range and the percentage associated to the range.
Here is the current data in the table:
1 0.00 4999.00 13.0
2 5000.00 .00 12.5
3 1.00 14999.00 12.0
4 15000.00
Matt
- Original Message -
From: "Gabriel Ricard"
Sent: Wednesday, November 12, 2003 10:00 AM
Subject: Re: Dirt Slow Query On Datetime Range...the saga continues
> In order to make sure of a multi-column index, you have to order the
> WHERE clauses in the same order as the
t
you
know is a better choice?
Thanks again,
Michael Shuler
-Original Message-
From: Michael Shuler [mailto:[EMAIL PROTECTED]
Sent: Tuesday, November 11, 2003 3:44 PM
To: [EMAIL PROTECTED]
Subject: Dirt Slow Query On Datetime Range
OK, I give up. To anyone out there who can help me, please
[EMAIL PROTECTED]
Subject: Dirt Slow Query On Datetime Range
OK, I give up. To anyone out there who can help me, please explain why this
query runs slower than dirt. The table has about 1,300,000 records in it,
which is not supposed to be a big deal for MySQL to deal with. I have tried
it with MyISA
"Mike Johnson"
Sent: Tuesday, November 11, 2003 4:17 PM
Subject: RE: Dirt Slow Query On Datetime Range
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Change your query to use BETWEEN rather that <= and >=.
>
> --ja
> > And here is the query:
> >
> >
, November 11, 2003 4:02 PM
To: Michael Shuler
Cc: [EMAIL PROTECTED]
Subject: Re: Dirt Slow Query On Datetime Range
The first thing I noticed is that you are using varchar instead of
char, why? Unless you have a variable length field like text or blob,
you can and should use char.
As far as I know, you
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Change your query to use BETWEEN rather that <= and >=.
>
> --ja
> > And here is the query:
> >
> > SELECT COUNT(*) AS CallCount FROM ServiceRADIUSAccounting
> WHERE (Realm =
> > 'testreal.com') AND (AcctStartTime <= '2003-11-11 15:30:00'
Change your query to use BETWEEN rather that <= and >=.
--ja
On Tue, 11 Nov 2003, Michael Shuler wrote:
> OK, I give up. To anyone out there who can help me, please explain why this
> query runs slower than dirt. The table has about 1,300,000 records in it,
> which is not supposed to be a big
The first thing I noticed is that you are using varchar instead of
char, why? Unless you have a variable length field like text or blob,
you can and should use char.
As far as I know, you can't "optimize" InnoDB tables, but you can
optimize MyISAM using the analyze command as I recall.
Next, ha
OK, I give up. To anyone out there who can help me, please explain why this
query runs slower than dirt. The table has about 1,300,000 records in it,
which is not supposed to be a big deal for MySQL to deal with. I have tried
it with MyISAM and then changed it to InnoDB which made it even slower
00,000 rows. I have indexes on start, end and
(start,end). start and end are unique.
'end' is the primary key.
there are supposed to be no overlaps, but there are
numbers that are not covered by any range.
'explain' sometimes shows the query using a key, sometimes it doesn't
:-
; is the primary key.
there are supposed to be no overlaps, but there are
numbers that are not covered by any range.
'explain' sometimes shows the query using a key, sometimes it doesn't
:-(... all of this is kind of
'random'. The table is rather static (<100 updates /
gt;
Sent: Sunday, October 05, 2003 1:08 AM
Subject: ip range lookup
> I have a table that maps ip-ranges to countries: each record consists of 2
> ip numbers (unsigned int's) and the country in which all ip's between
those
> two are located.
> How should I setup the table t
Hi Willem,
I don't *think* MySQL optimizes BETWEEN like that to use an index.
Have you tried this?:
SELECT * FROM ipcountry WHERE ip1 >= 123456789 AND ip2 <= 123456789;
Matt
- Original Message -
From: "Willem Bison"
Sent: Saturday, October 04, 2003 6:08 PM
Sub
I have a table that maps ip-ranges to countries: each record consists of 2
ip numbers (unsigned int's) and the country in which all ip's between those
two are located.
How should I setup the table to have fast ip lookups ?
Making a primary key of the 2 ip's and doing a 'select .. between ip1 and
ip
Hi,
try this:
SELECT * FROM your_table
WHERE StartDate > NOW()
AND EndDate < NOW()
> Hello,
>
> I am having a problem when doing a SELECT. Here is the
> scenerio:
>
> I have a table that has an event StartDate and
> EndDate, based on the current Date "NOW()" I need to
> know which records are
1 - 100 of 151 matches
Mail list logo