Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql Performance > Re: mysterious ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 3 of 8 Topic 4014 of 4352
Post > Topic >>

Re: mysterious difference in speed when combining two queries with OR

by andreas.kretschmer@[EMAIL PROTECTED] ("A. Kretschmer") Apr 23, 2008 at 10:57 AM

am  Wed, dem 23.04.2008, um  9:58:10 +0200 mailte A. Kretschmer folgendes:
> > Query A (two queries)
> > 
> > select distinct moment.mid from moment,timecard where parent = 45 and
(pid=17 and timecard.mid = moment.mid) order by moment.mid;
> > select distinct moment.mid from moment,timecard where parent = 45 and
(pbar = 0) order by moment.mid;
> > 
> > Query B (combining the two with OR)
> > 
> > select distinct moment.mid from moment,timecard where parent = 45 and
((pid=17 and timecard.mid = moment.mid) or (pbar = 0)) order by
moment.mid;

Thanks to depesz on #postgresql (irc-channel):

Query A, the second query: there are no join between the 2 tables.
Mistake?


Andreas
-- 
Andreas Kretschmer
Kontakt:  Heynitz: 035242/47150,   D1: 0160/7141639 (mehr: -> Header)
GnuPG-ID:   0x3FFF606C, privat 0x7F4584DA   http://wwwkeys.de.pgp.net

-- 
Sent via pgsql-performance mailing list (pgsql-performance@[EMAIL PROTECTED]
)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance
 




 8 Posts in Topic:
mysterious difference in speed when combining two queries with O
hans.ekbrand@[EMAIL PROTE  2008-04-23 09:23:07 
Re: mysterious difference in speed when combining two queries wi
andreas.kretschmer@[EMAIL  2008-04-23 09:58:10 
Re: mysterious difference in speed when combining two queries wi
andreas.kretschmer@[EMAIL  2008-04-23 10:57:04 
Re: mysterious difference in speed when combining two queries wi
hans.ekbrand@[EMAIL PROTE  2008-04-23 11:22:09 
Re: mysterious difference in speed when combining two
hans.ekbrand@[EMAIL PROTE  2008-04-23 11:06:08 
Re: mysterious difference in speed when combining two queries wi
theo@[EMAIL PROTECTED] (  2008-04-23 13:00:07 
Re: mysterious difference in speed when combining two queries wi
lists@[EMAIL PROTECTED]   2008-04-23 14:56:56 
Re: mysterious difference in speed when combining two queries wi
stark@[EMAIL PROTECTED]   2008-04-23 09:31:39 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sun Oct 12 14:37:00 CDT 2008.