Re: [Nolug] MySQL Help?

From: Mark A. Hershberger <mah_at_everybody.org>
Date: Sun, 30 May 2004 00:20:28 -0400
Message-ID: <87fz9io8ab.fsf@weblog.localhost>

Ron Johnson <ron.l.johnson@cox.net> writes:

> WHERE zip in (SELECT zip from zipDistances...) ?
>
> I should hope so! That's what INNER JOIN is for.

No. Not even that smart. The SELECT statement was passed through a
pre-processor which expanded the pseudo-function ZIP_PROXIMITY from
this:

    SELECT * from tblData WHERE ZIP_PROXIMITY(70118,25);

To this:

    SELECT * from tblData WHERE zip in (70118,...[all zips within 25
        miles]);

I created the zipDistances table and pre-populated it so that we could
change it to:

    SELECT * from tblData,zipDistances WHERE zip=zip_distant AND
       origin = 70118 AND distance = 25;

>> And, it shouldn't lock the table, right?
>
> Well, I've heard that table locking has traditionally
> been MySQL's favorite kind of locking, from it's roots
> where it was weighted towards read-heavy environments.

Ugh.

If this is the case, then that is likely what I'm seeing.

Mark.

-- 
A choice between one man and a shovel, or a dozen men with teaspoons
is clear to me, and I'm sure it is clear to you also.
    -- Zimran Ahmed <http://www.winterspeak.com/>
___________________
Nolug mailing list
nolug@nolug.org
Received on 05/29/04

This archive was generated by hypermail 2.2.0 : 12/19/08 EST