On Mon, Mar 31, 2003 at 11:42:37AM -0600, Michael Muratet wrote:
> 
> I have discovered that it is the placement of single quotes around the
> key value in the query:
> 
> >     my $rth = $dbh->prepare("SELECT * FROM demographics_1 WHERE
> >     KEY1=$key");
> 
> that makes the difference. The above takes 90 secs.
> 
> The below takes milliseconds (as it does from the command line):
> 
> >     my $rth = $dbh->prepare("SELECT * FROM demographics_1 WHERE
> >     KEY1='$key'");
> 
> Without the single quotes, the command line interface will tell you that
> you have a bogus column name. I guess the DBI interface is able to
> figure it out, but it takes awhile.
> 
> If anyone has any insight to what happens, I'm curious to know.

What is the type of the KEY1 field? And what is the definition of
any index built on that field? (Ideally just post the output of
"show create table demographics_1;").

Also, what's the exact version of mysql server you're using?
(Check by using \s in the mysql client.)

Tim.

p.s. You can probably ignore the subthread on placeholders for now.
I think the issue is on the server side.

Reply via email to