On Tue 18 May 02004 at 08:49:05PM +0200, Jigal van Hemert wrote:
> > There are about 1.7 million 10-character long strings. A query like this
> one
> > takes about 5 seconds:
> >
> > SELECT junk FROM data WHERE junk='xxxxxxxxxx';
> >
> > Subsequent queries for the same string return right away.
> 
> That's because you have the mysql query cache enabled and mysql can return
> the answer immediately without running the query at all.

Figured as much.

> 
> > Is it normal for this to take so long? Grepping against a flat text file
> > representing my data takes a far less than a second. Any thoughts, folks?
> 
> - What is the output of EXPLAIN SELECT junk FROM data WHERE
> junk='xxxxxxxxxx'; ?
> - What if you OPTIMIZE data; ? Does it get any faster?
> 
> Regards, Jigal.
> 

I optimized the table, but the difference in speed is not signifigant.
Average query times are still between 4.45 and 5.0 seconds.

I've worked with MySQL in the past but never with so many rows. Is 1.7
million a lot for MySQL? Why would this be so much slower than grep?

-- 
Jacob Elder

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

Reply via email to