Re: Delete large amount of records and INSERT (with indexes) goes VERY slow

From: Peter Nixon <listuser(at)peternixon(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Delete large amount of records and INSERT (with indexes) goes VERY slow
Date: 2003-04-11 10:32:26
Message-ID: 200304111332.26365.listuser@peternixon.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu April 10 2003 17:00, you wrote:
> Peter Nixon <listuser(at)peternixon(dot)net> writes:
> > Yes. But that still doesn't explain the speed. I am not joking when I
> > said I was getting only ONE INSERT every 30 seconds - 1 minute!!!
>
> The insertion itself couldn't possibly take that long; the problem had
> to be in auxiliary operations invoked by the insert. Do you have any
> triggers on that table? Any foreign references to or from it? What
> indexes are on the table?

There is only one index. The structure is the following..

CREATE TABLE StopVoIP (
RadAcctId BIGSERIAL PRIMARY KEY,
UserName VARCHAR(32) DEFAULT '' NOT NULL,
NASIPAddress INET NOT NULL,
AcctSessionTime BIGINT,
AcctInputOctets BIGINT,
AcctOutputOctets BIGINT,
CalledStationId VARCHAR(50) DEFAULT '' NOT NULL,
CallingStationId VARCHAR(50) DEFAULT '' NOT NULL,
AcctDelayTime SMALLINT,
CiscoNASPort BOOLEAN DEFAULT false,
h323CallOrigin varchar(10) DEFAULT '' NOT NULL,
h323SetupTime timestamp with time zone NOT NULL,
h323ConnectTime timestamp with time zone NOT NULL,
h323DisconnectTime timestamp with time zone NOT NULL,
h323DisconnectCause varchar(2) DEFAULT '' NOT NULL,
H323RemoteAddress INET NOT NULL,
H323VoiceQuality NUMERIC(2),
h323ConfID VARCHAR(35) DEFAULT '' NOT NULL
);
create UNIQUE index stopvoipcombo on stopvoip (h323SetupTime, nasipaddress,
h323ConfID);

--

Peter Nixon
http://www.peternixon.net/
PGP Key: http://www.peternixon.net/public.asc

In response to

Browse pgsql-general by date

  From Date Subject
Next Message tom dyson 2003-04-11 11:38:21 conditional constraints
Previous Message Richard Huxton 2003-04-11 08:38:46 Re: Batch replication ordering (was Re: [GENERAL] 32/64-bit transaction IDs?)