pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Rainer Mager <rmager@vgkk.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: PostgreSQL Admin <pgsql-admin@postgresql.org>
Subject: RE: High memory usage
Date: Wed, 20 Jun 2001 17:01:22 +0900
Message-ID: <NEBBJBCAFMMNIHGDLFKGEEGAEFAA.rmager@vgkk.com> (raw)
In-Reply-To: <NEBBJBCAFMMNIHGDLFKGCEFOEFAA.rmager@vgkk.com>

More info on this...

First, this type of query seems to use exponential amounts of memory. I
tried a join with 10 pieces (the one below with 9 used ~60MB) and it went up
immediately to ~ 390MB usage and has been sitting there at 100% CPU usage
for more than 10 minutes. This is on a database with almost no data in it.
Similarly, a query with only 8 joins is very quick and has much lower memory
usage.


Best regards,

--Rainer


> -----Original Message-----
> From: Rainer Mager [mailto:rmager@vgkk.com]
> Sent: Wednesday, June 20, 2001 4:19 PM
> To: Tom Lane
> Cc: PostgreSQL Admin
> Subject: RE: [ADMIN] High memory usage
>
>
> Hi,
>
> 	Here is a query that demonstrates the problem. Running this
> takes about 60MB until it is done at which time it is freed (I
> was wrong when I said otherwise earlier). Interestingly, the same
> amount of memory is used when doing an EXPLAIN on this query.
> Also it happens to return 0 rows. Please excuse the weird
> characters in the middle this is a Japanese (UTF8) database. Also
> please excuse Outlook breaking the query, it is just one long line.
>
>
> SELECT DISTINCT product.product_id FROM product, pr_prop_str
> alias_table_0, pr_prop_str alias_table_1, pr_prop_str
> alias_table_2, pr_prop_str alias_table_3, pr_prop_str
> alias_table_4, pr_prop_str alias_table_5, pr_prop_str
> alias_table_6, pr_prop_str alias_table_7, pr_prop_str
> alias_table_8 WHERE product.product_id = alias_table_0.product_id
> AND product.product_id = alias_table_1.product_id AND
> product.product_id = alias_table_2.product_id AND
> product.product_id = alias_table_3.product_id AND
> product.product_id = alias_table_4.product_id AND
> product.product_id = alias_table_5.product_id AND
> product.product_id = alias_table_6.product_id AND
> product.product_id = alias_table_7.product_id AND
> product.product_id = alias_table_8.product_id AND (
> alias_table_0.pr_property_id = 147 AND alias_table_0.str =
> '3E362cb' ) AND ( alias_table_1.pr_property_id = 18 AND
> alias_table_1.str > '000999999' ) AND (
> alias_table_2.pr_property_id = 18 AND alias_table_2.str <
> '004999999' ) AND ( alias_table_3.pr_property_id = 51 AND
> alias_table_3.str = '蛬Oウ瘢雹縷C~O縷Cウ瘢雹縷C~I縷Cォ' ) AND (
> alias_table_4.pr_property_id = 115 AND alias_table_4.str = '1' )
> AND ( alias_table_5.pr_property_id = 68 AND alias_table_5.str =
> '05' ) AND ( alias_table_6.pr_property_id = 113 AND
> alias_table_6.str < '030001' ) AND ( alias_table_7.pr_property_id
> = 57 AND alias_table_7.str < '19980101' ) AND (
> alias_table_8.pr_property_id = 158 AND alias_table_8.str = '1' );




view thread (11+ messages)  latest in thread

Message-ID: <NEBBJBCAFMMNIHGDLFKGEEGAEFAA.rmager@vgkk.com>
Permalink:  ../NEBBJBCAFMMNIHGDLFKGEEGAEFAA.rmager@vgkk.com/
Also on:    postgresql.org/message-id/NEBBJBCAFMMNIHGDLFKGEEGAEFAA.rmager@vgkk.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 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-admin@postgresql.org
  Cc: rmager@vgkk.com, tgl@sss.pgh.pa.us
  Subject: Re: High memory usage
  In-Reply-To: <NEBBJBCAFMMNIHGDLFKGEEGAEFAA.rmager@vgkk.com>
  References: <NEBBJBCAFMMNIHGDLFKGCEFOEFAA.rmager@vgkk.com> <NEBBJBCAFMMNIHGDLFKGEEGAEFAA.rmager@vgkk.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