pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Stephan Szabo <sszabo@megazone23.bigpanda.com>
To: MindTerm <mindterm@yahoo.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: performance tuning in large function / transaction
Date: Mon, 17 Dec 2001 23:50:15 -0800 (PST)
Message-ID: <20011217234256.L57934-100000@megazone23.bigpanda.com> (raw)
In-Reply-To: <20011218073907.397.qmail@web20209.mail.yahoo.com>

On Mon, 17 Dec 2001, MindTerm wrote:

>        select count(*)
>        from   ACL a, APPLICATION app
>        where  ACL_APP            = app.app_id
>        and    APP_INSTALLED      = 'Y'
>        and    ACL_LEVEL          > 0
>        and    ACL_GALLERY_ID     = 1
>        and    app.APP_GALLERY_ID = 1
>        and    substr(app.app_order,1, 6 ) = '021101'
>        and    app.app_order      <> '021101'
>        and    exists
>               (select u.ug_id
>                from   user_group u, user_group_master
> ug
>                where  a.ACL_GRP = u.ug_id
>                and    u.ug_user_id = 5170
>                and    ug.ug_id     = u.ug_id
>                and   (ug.deleted   = 'N' or ug.deleted
> IS NULL)
>                and    u.gallery_id = 1
>                and    ug.gallery_id = 1 );

I don't know if it'll help, but does:

select count(*)
 from ACL a, APPLICATION app, user_group u,
 user_group_master ug
        where  ACL_APP            = app.app_id
        and    APP_INSTALLED      = 'Y'
        and    ACL_LEVEL          > 0
        and    ACL_GALLERY_ID     = 1
        and    app.APP_GALLERY_ID = 1
        and    substr(app.app_order,1, 6 ) = '021101'
        and    app.app_order      <> '021101'
        and    a.ACL_GRP = u.ug_id
                and    u.ug_user_id = 5170
                and    ug.ug_id     = u.ug_id
                and   (ug.deleted   = 'N' or ug.deleted
 IS NULL)
                and    u.gallery_id = 1
                and    ug.gallery_id = 1;

give the same results as the original query.  Maybe
that form will work faster.  (I'm going to play with
it a little tomorrow, but since I don't have much data
in there, I'm not sure how well it'll translate)




view thread (23+ messages)  latest in thread

Message-ID: <20011217234256.L57934-100000@megazone23.bigpanda.com>
Permalink:  ../20011217234256.L57934-100000@megazone23.bigpanda.com/
Also on:    postgresql.org/message-id/20011217234256.L57934-100000@megazone23.bigpanda.com

 · 

reply

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 using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: sszabo@megazone23.bigpanda.com, mindterm@yahoo.com
  Subject: Re: performance tuning in large function / transaction
  In-Reply-To: <20011217234256.L57934-100000@megazone23.bigpanda.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