Port Bug Report: Wild memory use for badly written SQL

From: Unprivileged user <nobody>
To: pgsql-ports(at)postgresql(dot)org
Subject: Port Bug Report: Wild memory use for badly written SQL
Date: 1999-06-02 19:23:17
Message-ID: 199906021923.PAA11395@hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-ports


============================================================================
POSTGRESQL BUG REPORT TEMPLATE
============================================================================

Your name : Urban Widmark
Your email address : urban(at)svenskatest(dot)se

Category : runtime: back-end: SQL
Severity : serious

Summary: Wild memory use for badly written SQL

System Configuration
--------------------
Operating System : Linux 2.2.x & 2.3.x

PostgreSQL version : 6.5beta and 6.4.2 (I think)

Compiler used : gcc 2.7.2.3

Hardware:
---------
Linux tux.svenskatest.se 2.2.7 #1 Sun May 2 12:04:13 CEST 1999 i586 unknown
Upgraded RedHat 5.0
Pentium, 32M RAM, IDE, eepro 10/100 pci

Versions of other tools:
------------------------
GNU tools (make, flex, ...)

--------------------------------------------------------------------------

Problem Description:
--------------------
Memory usage for the postmaster process is huge (more than
the ~300M virtually available) for a certain SQL statement,
even with empty data tables.

I find it unlikely that it should need that much space to
handle the statement on an empty table.

This is especially bad on systems where the kernel kills a
random process when running out of memory (eg Linux 2.2/2.3).

--------------------------------------------------------------------------

Test Case:
----------
JDBC access to the following table:

Table = ts_syllabus
| Field | Type | Length|
+----------------------------------+----------------------------------+-------+
| ts_lang | varchar() not null | 50 |
| ts_key | varchar() not null | 50 |
| ts_val | varchar() | 2000 |

select * from ts_syllabus where
(ts_key like '1%' and ts_lang='swe') or
(ts_key like '2%' and ts_lang='swe') or
(ts_key like '3%' and ts_lang='swe') or
(ts_key like '4%' and ts_lang='swe') or
(ts_key like '5%' and ts_lang='swe') or
(ts_key like '6%' and ts_lang='swe') or
(ts_key like '7%' and ts_lang='swe') or
(ts_key like '8%' and ts_lang='swe') or
(ts_key like '9%' and ts_lang='swe')

--------------------------------------------------------------------------

Solution:
---------

--------------------------------------------------------------------------

Responses

Browse pgsql-ports by date

  From Date Subject
Next Message Bruce Momjian 1999-06-02 20:09:14 Re: [PORTS] Port Bug Report: Wild memory use for badly written SQL
Previous Message G. Anthony Reina 1999-06-02 18:46:33 Windows 95 PgAccess Help with PSQL