[PHP-DB] need help on improving performance on this querry

2002-05-07 Thread andy

Hi there,

I do have a user table with 3 languages. I know that I should have put them
into a seperate table. I still could, but would take lots of recoding. I
discovered, that as soon as I leave out the OR statements the querry takes
under 0.2 s. With the two OR it takes on a 1 records about 1.4 s.

Is there a way to increase the performance with a different querry? I did
already index the fields, but does not look much better though.

SELECT DISTINCT L.*
from data.languages L, data2.user U
where
  L.id = U.language_1
  or L.id = U.language_2
  or L.id = U.language_3
order by name

Thanx for any help,

Andy



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] need help on improving performance on this querry

2002-05-07 Thread szii

SELECT DISTINCT L.*
from data.languages L, data2.user U
WHERE L.id IN (U.language_1, U.language_2, U.language_3)
order by name;

I believe the IN clause is a shade faster than multiple ORs, but 
I'm not 100% sure.

'Luck

-Szii 

- Original Message - 
From: andy [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, May 07, 2002 9:38 AM
Subject: [PHP-DB] need help on improving performance on this querry


 Hi there,
 
 I do have a user table with 3 languages. I know that I should have put them
 into a seperate table. I still could, but would take lots of recoding. I
 discovered, that as soon as I leave out the OR statements the querry takes
 under 0.2 s. With the two OR it takes on a 1 records about 1.4 s.
 
 Is there a way to increase the performance with a different querry? I did
 already index the fields, but does not look much better though.
 
 SELECT DISTINCT L.*
 from data.languages L, data2.user U
 where
   L.id = U.language_1
   or L.id = U.language_2
   or L.id = U.language_3
 order by name
 
 Thanx for any help,
 
 Andy
 
 
 
 -- 
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] need help on improving performance on this querry

2002-05-07 Thread andy

thank you! I did not know this command.

Its 0.16s instead of 1.6!

Andy


[EMAIL PROTECTED] schrieb im Newsbeitrag
043c01c1f5f2$47f5b3e0$[EMAIL PROTECTED]">news:043c01c1f5f2$47f5b3e0$[EMAIL PROTECTED]...
 SELECT DISTINCT L.*
 from data.languages L, data2.user U
 WHERE L.id IN (U.language_1, U.language_2, U.language_3)
 order by name;

 I believe the IN clause is a shade faster than multiple ORs, but
 I'm not 100% sure.

 'Luck

 -Szii

 - Original Message -
 From: andy [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Tuesday, May 07, 2002 9:38 AM
 Subject: [PHP-DB] need help on improving performance on this querry


  Hi there,
 
  I do have a user table with 3 languages. I know that I should have put
them
  into a seperate table. I still could, but would take lots of recoding. I
  discovered, that as soon as I leave out the OR statements the querry
takes
  under 0.2 s. With the two OR it takes on a 1 records about 1.4 s.
 
  Is there a way to increase the performance with a different querry? I
did
  already index the fields, but does not look much better though.
 
  SELECT DISTINCT L.*
  from data.languages L, data2.user U
  where
L.id = U.language_1
or L.id = U.language_2
or L.id = U.language_3
  order by name
 
  Thanx for any help,
 
  Andy
 
 
 
  --
  PHP Database Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php