Re: Only getting few records inserted from millions

From: Erik Wienhold <ewie(at)ewie(dot)name>
To: Anthony Apollis <anthony(dot)apollis(at)gmail(dot)com>, pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Only getting few records inserted from millions
Date: 2023-09-07 17:39:07
Message-ID: 1775058340.130266.1694108347636@office.mailbox.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 07/09/2023 19:14 CEST Anthony Apollis <anthony(dot)apollis(at)gmail(dot)com> wrote:

> The problem is that I am only getting 19 rows inserted into my destination
> table. My source has over 5 million rows. What am I doing wrong?

Few ideas:

* Column dim."IMETA_Entity_Mapping"."Entity_Secondary_Key" allows NULL but the
join condition in your SELECT does not account for that. That may be the
reason you get less rows than expected. The columns of the other join
conditions are all NOT NULL as far as I can tell.

* Index corruption is also one possibility.

* Are there BEFORE triggers on the destination table that may prevent the INSERT
of most rows (assuming that the SELECT returns the expected rows)?

--
Erik

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2023-09-07 19:09:41 Re: Huge input lookup exception when trying to create the index for XML data type column in postgreSQL
Previous Message Sai Teja 2023-09-07 17:28:30 Huge input lookup exception when trying to create the index for XML data type column in postgreSQL