If running two queries is running faster than perhaps the best way to do 
it is select the first query into a temporary table and then insert 
select the second to append to the temp table. Then you can select and 
sort however you want from the temporary table.

create table tempname SELECT something from table...
insert into tempname (something columns) SELECT something from table...
select something from tempname order by column

Three steps instead of one, but if it runs faster then it helps.

On Thursday, August 1, 2002, at 11:11 AM, James MacLean wrote:

> On Thu, 1 Aug 2002, Ralf Narozny wrote:
>
>> Hello!
>>
>> James MacLean wrote:
>>
>>> Hi Folks,
>>> Have only known enough SQL to do what we needed.
>>> Today on mysql-3.23.51 we found out that :
>>> select something from table where index1 = 'value' or index2 = 
>>> 'value';
>>> Runs considerably slower than:
>>> select something from table where index1 = 'value';
>>> or
>>> select something from table where index2 = 'value';
>>
>> Does it have a compund index, created like this:
>> CREATE INDEX myindex ON table (index1,index2);
>>
>> ???
>> Greetings
>>  Ralf
>
> Just tried that and it almost doubled my time again (to over 1sec) :(.
>
> Thanks for the idea though :), welcome any more :),
> JES
> --
> James B. MacLean        [EMAIL PROTECTED]
> Department of Education
> Nova Scotia, Canada
> B3M 4B2
>
>
> ---------------------------------------------------------------------
> Before posting, please check:
>    http://www.mysql.com/manual.php   (the manual)
>    http://lists.mysql.com/           (the list archive)
>
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail <mysql-unsubscribe-
> [EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
>
>
--
Brent Baisley
Systems Architect
Landover Associates, Inc.
Search & Advisory Services for Advanced Technology Environments
p: 212.759.6400/800.759.0577


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to