From: mallah@trade-india.com
To: scott.marlowe@ihs.com
Cc: mallah@trade-india.com
Cc: sean@chittenden.org
Cc: pgsql-performance@postgresql.org
Cc: jesse@fsck.com
Subject: Re: PostgreSQL 7.4beta5 vs MySQL 4.0.16 with RT(DBIx::SearchBuilder)
Date: Thu, 30 Oct 2003 03:47:09 +0530 (IST)
Message-ID: <33509.203.145.130.142.1067465829.squirrel@mail.trade-india.com> (raw)
In-Reply-To: <Pine.LNX.4.33.0310291446430.22074-100000@css120.ihs.com>
References: <33342.203.145.130.142.1067458976.squirrel@mail.trade-india.com>
<Pine.LNX.4.33.0310291446430.22074-100000@css120.ihs.com>
> On Thu, 30 Oct 2003 mallah@trade-india.com wrote:
>
>> >> So its not just PostgreSQL that is suffering from the bad SQL but MySQL also. But the
>> >> question is my does PostgreSQL suffer so badly ?? I think not all developers write very
>> >> nice SQLs.
>> >>
>> >> Its really sad to see that a fine peice of work (RT) is performing sub-optimal becoz of
>> >> malformed SQLs. [ specially on database of my choice ;-) ]
>> >
>> > Post EXPLAIN ANALYZES of the queries you're running, then maybe you'll be able to get some
>> > useful help from this list. Until then, it's very hard to speculate as to why PostgreSQL is
>> > slower. -sc
>>
>> Here It is:
>>
>> in case they are illegeble please lemme know i will attach it as .txt files.
>>
>> Slower One:
>>
>> explain analyze SELECT DISTINCT main.* FROM Groups main , Principals Principals_1, ACL ACL_2
>> WHERE ((ACL_2.RightName = 'OwnTicket')OR(ACL_2.RightName = 'SuperUser')) AND ( (
>> ACL_2.PrincipalId = Principals_1.id AND ACL_2.PrincipalType = 'Group' AND ( main.Domain =
>> 'SystemInternal' OR main.Domain = 'UserDefined' OR main.Domain = 'ACLEquivalence') AND main.id
>> = Principals_1.id) OR ( ( (main.Domain = 'RT::Queue-Role' AND main.Instance = 25) OR (
>> main.Domain = 'RT::Ticket-Role' AND main.Instance = 6973) ) AND main.Type =
>> ACL_2.PrincipalType AND main.id = Principals_1.id) ) AND (ACL_2.ObjectType = 'RT::System' OR
>> (ACL_2.ObjectType = 'RT::Queue' AND ACL_2.ObjectId = 25) ) ORDER BY main.Name ASC ;
>
> Note here:
>
> Merge Join
> (cost=1788.68..4735.71 rows=1 width=85)
> (actual time=597.540..1340.526 rows=20153 loops=1)
> Merge Cond: ("outer".id = "inner".id)
>
> This estimate is WAY off. Are both of those fields indexed and analyzed?
Yes both are primary keys. and i did vacuum full verbose analyze;
Have you tried
> upping the statistics target on those two fields?
> I assume they are compatible types.
Yes they are
>
> You might try 'set enable_mergejoin = false' and see if it does something faster here. Just a
> guess.
Did not help
regds
mallah.
-----------------------------------------
Over 1,00,000 exporters are waiting for your order! Click below to get
in touch with leading Indian exporters listed in the premier
trade directory Exporters Yellow Pages.
http://www.trade-india.com/dyn/gdh/eyp/
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-performance@postgresql.org
Cc: mallah@trade-india.com, scott.marlowe@ihs.com, sean@chittenden.org, jesse@fsck.com
Subject: Re: PostgreSQL 7.4beta5 vs MySQL 4.0.16 with RT(DBIx::SearchBuilder)
In-Reply-To: <33509.203.145.130.142.1067465829.squirrel@mail.trade-india.com>
References: <33342.203.145.130.142.1067458976.squirrel@mail.trade-india.com> <Pine.LNX.4.33.0310291446430.22074-100000@css120.ihs.com> <33509.203.145.130.142.1067465829.squirrel@mail.trade-india.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox