Skip site navigation (1) Skip section navigation (2)

BUG #3680: memory leak when excuting a SQL "select count(id) from chinatelecom;"

From: "ssurui" <ssurui(at)gmail(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #3680: memory leak when excuting a SQL "select count(id) from chinatelecom;"
Date: 2007-10-16 20:43:16
Message-ID: 200710162043.l9GKhGeF091013@wwwmaster.postgresql.org (view raw or flat)
Thread:
Lists: pgsql-bugs
The following bug has been logged online:

Bug reference:      3680
Logged by:          ssurui
Email address:      ssurui(at)gmail(dot)com
PostgreSQL version: 8.2.3
Operating system:   Redhat LINUX Advance server 3
Description:        memory leak when excuting a SQL "select count(id) from
chinatelecom;"
Details: 

I use postgresql 8.2.3 to build a charger system.  chinatelecom is a table
name,use such command to create it : 
CREATE TABLE chinatelecom 
(
  id serial NOT NULL,
  company_id char(2) DEFAULT 'XX'::bpchar,
  service_id char(2) DEFAULT 'XX'::bpchar,
  inner_flag char(2) DEFAULT 'XX'::bpchar,
  terminal_id char(8) DEFAULT '00000000'::bpchar,
  worker_id char(8) DEFAULT '00000000'::bpchar,
  contract_id varchar(30) DEFAULT '0'::character varying,
  phone_number varchar(30) DEFAULT '0'::character varying,
  money numeric DEFAULT 0,
  trade_code varchar(3) DEFAULT '000'::character varying,
  record_date date DEFAULT ('now'::text)::date,
  la_serial_number varchar(12) DEFAULT '0'::character varying,
  serial_number varchar(12) DEFAULT '0'::character varying,
  record_time char(30),
  CONSTRAINT chinatelecom_pkey PRIMARY KEY (id)
) 
WITHOUT OIDS;
ALTER TABLE chinatelecom OWNER TO postgres;
GRANT SELECT, UPDATE, INSERT, DELETE, REFERENCES, TRIGGER ON TABLE
chinatelecom TO postgres;
GRANT SELECT, UPDATE, INSERT, DELETE, REFERENCES, TRIGGER ON TABLE
chinatelecom TO public;

after the system runs about 4 months, the table has 2,000,000 records.

I use pgAdmin III to excute a simple SQL :
select count(*) from chinatelecom;

use top command observe the available memory, I find about 500MB memory is
vanished after the SQL is executed.

please tell me why it happened?

Responses

pgsql-bugs by date

Next:From: Douglas ToltzmanDate: 2007-10-16 21:01:01
Subject: Re: BUG #3680: memory leak when excuting a SQL "select count(id) from chinatelecom;"
Previous:From: thobiyasDate: 2007-10-16 13:07:50
Subject: BUG #3679: need windows version

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group