If I am correct, the NUMERIC data type is a string representation and will
contain leading zeroes if input as a string.
...
CREATE TABLE numbersTest (numCol NUMERIC(3));
INSERT INTO numbersTest VALUES('212'), ('069'), ('070');
...
The values with leading zeroes should be returned.
...
Create an index and see if your speed increases.

-----Original Message-----
From: 'Jacob Elder '
To: '''[EMAIL PROTECTED] ' ' '
Sent: 5/18/04 3:05 PM
Subject: Re: Simple table, 1.7 million rows, very slow SELECTs

On Tue 18 May 02004 at 02:48:45PM -0500, Victor Pendleton wrote:
> In this case creating separate columns and making the values integers
as
> oppesed to varchar will increase your query speed. 

Okay, I'll give that a try. How do I set up my column types so that a
leading 0 won't be stripped off?

> 
> -----Original Message-----
> From: Jacob Elder
> To: Victor Pendleton
> Cc: '[EMAIL PROTECTED] '; ''[EMAIL PROTECTED] ' '
> Sent: 5/18/04 2:11 PM
> Subject: Re: Simple table, 1.7 million rows, very slow SELECTs
> 
> On Tue 18 May 02004 at 02:03:55PM -0500, Victor Pendleton wrote:
> > From this explain plan it appears a full table scan will be done.
What
> is
> > the cardinality of this index?
> > 
> 
> Actually, they are phone numbers. I wasn't sure how this list would
feel
> about this but I am wring a National Do-Not-Call Registry complaince
> tool
> for internal use at my company. We are a real estate agency, not
> telemarketers. We don't make a ton of cold calls but we don't want to
> get
> sued either.
> 
> My table contains all do-not-call entries in Massachusetts. They are
> inserted in numeric order. Would it be faster if I broke it into
columns
> for
> area code, exchange, and subscriber?
> 
> -- 
> Jacob Elder
> 
> -- 
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]
> 

-- 
Jacob Elder

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:
http://lists.mysql.com/[EMAIL PROTECTED]

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to