pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Fw: Sub SELECTS
3+ messages / 3 participants
[nested] [flat]

* Fw: Sub SELECTS
@ 2002-09-25 14:51 Waruna Geekiyanage <waruna@nirmani.com>
  2002-09-25 15:08 ` Re: Fw: Sub SELECTS Keary Suska <hierophant@pcisys.net>
  2002-09-27 17:34 ` Re: Fw: Sub SELECTS Roland Roberts <roland@astrofoto.org>
  0 siblings, 2 replies; 3+ messages in thread

From: Waruna Geekiyanage @ 2002-09-25 14:51 UTC (permalink / raw)
  To: pgsql-php




I have a select query with 2 sub selects.
When I run that query CPU usage goes to 98% for postgres.
Does sub selects eat more resources and slower the queries?
Is there any alternatives to sub selects?

^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Fw: Sub SELECTS
  2002-09-25 14:51 Fw: Sub SELECTS Waruna Geekiyanage <waruna@nirmani.com>
@ 2002-09-25 15:08 ` Keary Suska <hierophant@pcisys.net>
  1 sibling, 0 replies; 3+ messages in thread

From: Keary Suska @ 2002-09-25 15:08 UTC (permalink / raw)
  To: pgsql-php

on 9/25/02 8:51 AM, waruna@nirmani.com purportedly said:

I have a select query with 2 sub selects.
When I run that query CPU usage goes to 98% for postgres.
Does sub selects eat more resources and slower the queries?
Is there any alternatives to sub selects?

That high CPU usage seems odd. I wouldn't think that even extremely complex
queries would effect CPU that much, unless there are other factors such as
low memory that would contribute.

If any case, if you post the query and table schemas we might be able to
make suggestions. Sub-selects are generally fairly efficient unless the
results from the sub-selects are particularly large. Postgres may not be
able to use indexes on sub-select results, I am not sure.

Keary Suska
Esoteritech, Inc.
"Leveraging Open Source for a better Internet"

^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Fw: Sub SELECTS
  2002-09-25 14:51 Fw: Sub SELECTS Waruna Geekiyanage <waruna@nirmani.com>
@ 2002-09-27 17:34 ` Roland Roberts <roland@astrofoto.org>
  1 sibling, 0 replies; 3+ messages in thread

From: Roland Roberts @ 2002-09-27 17:34 UTC (permalink / raw)
  To: pgsql-php

>>>>> "Waruna" == Waruna Geekiyanage <waruna@nirmani.com> writes:

    Waruna> I have a select query with 2 sub selects.  When I run that
    Waruna> query CPU usage goes to 98% for postgres.  Does sub
    Waruna> selects eat more resources and slower the queries?  Is
    Waruna> there any alternatives to sub selects?

You are going to have to give us a clue as to what those sub-selects
are and what they are doing.  If there is an "order by" clause
anywhere, that could cause high CPU.  If the query is not using
indicies, that might cause a problem.  Have you tried EXPLAIN?

roland
-- 
		       PGP Key ID: 66 BC 3B CD
Roland B. Roberts, PhD                             RL Enterprises
roland@rlenter.com                     76-15 113th Street, Apt 3B
roland@astrofoto.org                       Forest Hills, NY 11375



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2002-09-27 17:34 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2002-09-25 14:51 Fw: Sub SELECTS Waruna Geekiyanage <waruna@nirmani.com>
2002-09-25 15:08 ` Keary Suska <hierophant@pcisys.net>
2002-09-27 17:34 ` Roland Roberts <roland@astrofoto.org>

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