<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Target Postgres - Updating unnecessary columns in Qlik Replicate</title>
    <link>https://community.qlik.com/t5/Qlik-Replicate/Target-Postgres-Updating-unnecessary-columns/m-p/2417544#M9396</link>
    <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/156834"&gt;@Jon_Donker&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;While Replicate runs on Windows then it's much easier:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Open&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;PostgreSQL target endpoint&lt;/STRONG&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;Go to the&amp;nbsp;&lt;STRONG&gt;Advanced&lt;/STRONG&gt;&amp;nbsp;tab&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;Open&amp;nbsp;&lt;STRONG&gt;Internal Parameters&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;Add a&lt;EM class="Highlight"&gt;&lt;EM class="Highlight ht3ec7d61a-4558-4809-bebc-3c5e0889f80a"&gt;&amp;nbsp;new&amp;nbsp;&lt;/EM&gt;&lt;/EM&gt;parameter named &lt;FONT face="courier new,courier"&gt;$info.query_syntax.pk_segments_not_updateable&lt;/FONT&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;Set its value to &lt;FONT face="courier new,courier"&gt;TRUE&lt;/FONT&gt; and re-run the task, a sample:&lt;/SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="john_wang_0-1707710531171.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/159524i465AA6B65A0C7B62/image-size/medium?v=v2&amp;amp;px=400" role="button" title="john_wang_0-1707710531171.png" alt="john_wang_0-1707710531171.png" /&gt;&lt;/span&gt;
&lt;P&gt;Again, if the PK columns values are changed , then a reload is needed.&lt;/P&gt;
&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;Good luck,&lt;/P&gt;
&lt;P&gt;John.&lt;/P&gt;</description>
    <pubDate>Mon, 12 Feb 2024 04:03:32 GMT</pubDate>
    <dc:creator>john_wang</dc:creator>
    <dc:date>2024-02-12T04:03:32Z</dc:date>
    <item>
      <title>Target Postgres - Updating unnecessary columns</title>
      <link>https://community.qlik.com/t5/Qlik-Replicate/Target-Postgres-Updating-unnecessary-columns/m-p/2417533#M9389</link>
      <description>&lt;P&gt;Hi Team,&lt;/P&gt;
&lt;P&gt;I am investigating performance problems on a target Postgres database.&amp;nbsp; Most of the dml is UPDATE statements; updating a few select columns.&amp;nbsp; As a constraint of the business requirements; we have to have the task in Transaction apply mode.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;With logging turned up; I ran the following on the source:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;UPDATE dbo.my_table
SET field_1 = 10
WHERE
	key_1 = 'A' AND
	key_2 = 'B' AND
	key_3 = 'C';&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the qlik replicate logs; the update came through as:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;UPDATE dbo.my_dest_table
SET	key_1 = ?,
	key_2 = ?,
	key_3 = ?,
	field_1 = ?,
	field_2 = ?,
	field_3 = ?
WHERE
	key_1 = ? AND
	key_2 = ? AND
	key_3 = ?;&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This means that qlik is updating columns that it doesn't need to be; and more importantly it is updating the keys.&amp;nbsp; I'm not sure if the Postgres compiler is smart enough to work to know that no action is required; or it will try modifying the index on the keys; adding to performance overhead.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there a way to make qlik replicate update only columns that are necessary?&amp;nbsp; i.e.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;UPDATE dbo.my_dest_table
SET	field_1 = ?
WHERE
	key_1 = ? AND
	key_2 = ? AND
	key_3 = ?;&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Feb 2024 02:23:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Replicate/Target-Postgres-Updating-unnecessary-columns/m-p/2417533#M9389</guid>
      <dc:creator>Jon_Donker</dc:creator>
      <dc:date>2024-02-12T02:23:41Z</dc:date>
    </item>
    <item>
      <title>Re: Target Postgres - Updating unnecessary columns</title>
      <link>https://community.qlik.com/t5/Qlik-Replicate/Target-Postgres-Updating-unnecessary-columns/m-p/2417534#M9390</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/156834"&gt;@Jon_Donker&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Thanks for reaching out to Qlik Community!&lt;/P&gt;
&lt;P&gt;We may control the UPDATE behavior in Qlik Replicate however would you please elaborate why the task was set to Transactional Applying Mode, maybe the latency still builds up after the PK columns are excluded in the UPDATE SQL. We'd like to get an accurate understanding the task setting.&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;John.&lt;/P&gt;</description>
      <pubDate>Mon, 12 Feb 2024 02:35:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Replicate/Target-Postgres-Updating-unnecessary-columns/m-p/2417534#M9390</guid>
      <dc:creator>john_wang</dc:creator>
      <dc:date>2024-02-12T02:35:23Z</dc:date>
    </item>
    <item>
      <title>Re: Target Postgres - Updating unnecessary columns</title>
      <link>https://community.qlik.com/t5/Qlik-Replicate/Target-Postgres-Updating-unnecessary-columns/m-p/2417536#M9391</link>
      <description>&lt;P&gt;Hi John,&lt;/P&gt;
&lt;P&gt;Thanks for the reply.&lt;/P&gt;
&lt;P&gt;We have to have the task in transaction apply mode because we will eventually build triggers on the events of downstream tables and therefore must have that transactional integrity.&amp;nbsp; Since batch optimize builds up a net of the transactions; we will lose that integrity.&lt;/P&gt;
&lt;P&gt;At the moment there are no triggers on the destination tables; so there should be no performance impact that are caused by them.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Feb 2024 02:40:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Replicate/Target-Postgres-Updating-unnecessary-columns/m-p/2417536#M9391</guid>
      <dc:creator>Jon_Donker</dc:creator>
      <dc:date>2024-02-12T02:40:22Z</dc:date>
    </item>
    <item>
      <title>Re: Target Postgres - Updating unnecessary columns</title>
      <link>https://community.qlik.com/t5/Qlik-Replicate/Target-Postgres-Updating-unnecessary-columns/m-p/2417537#M9392</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/156834"&gt;@Jon_Donker&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Thanks for the clarification.&lt;/P&gt;
&lt;P&gt;What you got is the default behavior of PostgreSQL target database. We may change the PostgreSQL syntax, set&amp;nbsp;&lt;FONT face="courier new,courier"&gt;pk_segments_not_updateable&lt;/FONT&gt;, to &lt;FONT face="courier new,courier"&gt;TRUE&lt;/FONT&gt; to exclude the PK columns in the UPDATE SQL Statement however please be careful that if there is chance the PK columns values are changed in source side, then this changing may cuase data out of integrity issue.&lt;/P&gt;
&lt;P&gt;In summary, the default behavior is the most saft mode. Unless you can guarantee NO PK columns values change otherwise the above parameter should not be used.&lt;/P&gt;
&lt;P&gt;Hope this helps.&lt;/P&gt;
&lt;P&gt;John.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Feb 2024 02:51:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Replicate/Target-Postgres-Updating-unnecessary-columns/m-p/2417537#M9392</guid>
      <dc:creator>john_wang</dc:creator>
      <dc:date>2024-02-12T02:51:42Z</dc:date>
    </item>
    <item>
      <title>Re: Target Postgres - Updating unnecessary columns</title>
      <link>https://community.qlik.com/t5/Qlik-Replicate/Target-Postgres-Updating-unnecessary-columns/m-p/2417538#M9393</link>
      <description>&lt;P&gt;Sounds promising - where do I set "&lt;SPAN&gt;pk_segments_not_updateable"?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Feb 2024 02:58:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Replicate/Target-Postgres-Updating-unnecessary-columns/m-p/2417538#M9393</guid>
      <dc:creator>Jon_Donker</dc:creator>
      <dc:date>2024-02-12T02:58:14Z</dc:date>
    </item>
    <item>
      <title>Re: Target Postgres - Updating unnecessary columns</title>
      <link>https://community.qlik.com/t5/Qlik-Replicate/Target-Postgres-Updating-unnecessary-columns/m-p/2417540#M9394</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/156834"&gt;@Jon_Donker&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Please share the Replicate server platform (is it a Linux or Windows), and a sample SQL of source table creation DDL (and source DB type), I'd like to confirm it for you.&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;John.&lt;/P&gt;</description>
      <pubDate>Mon, 12 Feb 2024 03:02:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Replicate/Target-Postgres-Updating-unnecessary-columns/m-p/2417540#M9394</guid>
      <dc:creator>john_wang</dc:creator>
      <dc:date>2024-02-12T03:02:59Z</dc:date>
    </item>
    <item>
      <title>Re: Target Postgres - Updating unnecessary columns</title>
      <link>https://community.qlik.com/t5/Qlik-Replicate/Target-Postgres-Updating-unnecessary-columns/m-p/2417542#M9395</link>
      <description>&lt;P&gt;We're on Windows and our source DB type is Microsoft SQL.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The table (obscured for sensitivity is) :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE dbo.my_table(
	FIELD_01 numeric(5, 0) NULL,
	FIELD_02 numeric(5, 0) NULL,
	FIELD_03 varchar(6) NULL,
	FIELD_04 char(1) NULL,
	KEY_1 numeric(9, 0) NOT NULL,
	KEY_2 char(10) NOT NULL,
	KEY_3 char(2) NOT NULL,
	KEY_4 char(2) NOT NULL,
	FIELD_05 char(3) NULL,
	FIELD_06 char(15) NULL,
	
	UPDATE_FIELD numeric(11, 2) NULL,
	
	FIELD_07 numeric(5, 0) NULL,
	FIELD_08 numeric(11, 2) NULL,
	FIELD_09 numeric(11, 2) NULL,
	FIELD_10 char(20) NULL,
	FIELD_11 char(1) NULL,
	FIELD_12 char(1) NULL,
	FIELD_13 numeric(9, 0) NULL,
	FIELD_14 numeric(9, 0) NULL,
	FIELD_15 numeric(5, 0) NULL,
	x_y varchar(10) NULL,
PRIMARY KEY CLUSTERED 
(
	KEY_1 ASC,
	KEY_2 ASC,
	KEY_3 ASC,
	KEY_4 ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 12 Feb 2024 03:41:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Replicate/Target-Postgres-Updating-unnecessary-columns/m-p/2417542#M9395</guid>
      <dc:creator>Jon_Donker</dc:creator>
      <dc:date>2024-02-12T03:41:24Z</dc:date>
    </item>
    <item>
      <title>Re: Target Postgres - Updating unnecessary columns</title>
      <link>https://community.qlik.com/t5/Qlik-Replicate/Target-Postgres-Updating-unnecessary-columns/m-p/2417544#M9396</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/156834"&gt;@Jon_Donker&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;While Replicate runs on Windows then it's much easier:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Open&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;PostgreSQL target endpoint&lt;/STRONG&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;Go to the&amp;nbsp;&lt;STRONG&gt;Advanced&lt;/STRONG&gt;&amp;nbsp;tab&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;Open&amp;nbsp;&lt;STRONG&gt;Internal Parameters&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;Add a&lt;EM class="Highlight"&gt;&lt;EM class="Highlight ht3ec7d61a-4558-4809-bebc-3c5e0889f80a"&gt;&amp;nbsp;new&amp;nbsp;&lt;/EM&gt;&lt;/EM&gt;parameter named &lt;FONT face="courier new,courier"&gt;$info.query_syntax.pk_segments_not_updateable&lt;/FONT&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;Set its value to &lt;FONT face="courier new,courier"&gt;TRUE&lt;/FONT&gt; and re-run the task, a sample:&lt;/SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="john_wang_0-1707710531171.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/159524i465AA6B65A0C7B62/image-size/medium?v=v2&amp;amp;px=400" role="button" title="john_wang_0-1707710531171.png" alt="john_wang_0-1707710531171.png" /&gt;&lt;/span&gt;
&lt;P&gt;Again, if the PK columns values are changed , then a reload is needed.&lt;/P&gt;
&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;Good luck,&lt;/P&gt;
&lt;P&gt;John.&lt;/P&gt;</description>
      <pubDate>Mon, 12 Feb 2024 04:03:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Replicate/Target-Postgres-Updating-unnecessary-columns/m-p/2417544#M9396</guid>
      <dc:creator>john_wang</dc:creator>
      <dc:date>2024-02-12T04:03:32Z</dc:date>
    </item>
    <item>
      <title>Re: Target Postgres - Updating unnecessary columns</title>
      <link>https://community.qlik.com/t5/Qlik-Replicate/Target-Postgres-Updating-unnecessary-columns/m-p/2417548#M9397</link>
      <description>&lt;P&gt;Cheers - I can see that the PK columns are now excluded from the update.&amp;nbsp; Any way we can exclude the other non updated fields?&lt;/P&gt;</description>
      <pubDate>Mon, 12 Feb 2024 04:33:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Replicate/Target-Postgres-Updating-unnecessary-columns/m-p/2417548#M9397</guid>
      <dc:creator>Jon_Donker</dc:creator>
      <dc:date>2024-02-12T04:33:44Z</dc:date>
    </item>
    <item>
      <title>Re: Target Postgres - Updating unnecessary columns</title>
      <link>https://community.qlik.com/t5/Qlik-Replicate/Target-Postgres-Updating-unnecessary-columns/m-p/2417552#M9398</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/156834"&gt;@Jon_Donker&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;I do not see the possibility for SQL Server source.&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;John.&lt;/P&gt;</description>
      <pubDate>Mon, 12 Feb 2024 05:09:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Replicate/Target-Postgres-Updating-unnecessary-columns/m-p/2417552#M9398</guid>
      <dc:creator>john_wang</dc:creator>
      <dc:date>2024-02-12T05:09:36Z</dc:date>
    </item>
    <item>
      <title>Re: Target Postgres - Updating unnecessary columns</title>
      <link>https://community.qlik.com/t5/Qlik-Replicate/Target-Postgres-Updating-unnecessary-columns/m-p/2418544#M9464</link>
      <description>&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;Hello team,&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;If our response has been helpful, please consider clicking "Accept as Solution". This will assist other users in easily finding the answer.&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;Regards,&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;Sushil Kumar&lt;/P&gt;</description>
      <pubDate>Wed, 14 Feb 2024 06:11:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Replicate/Target-Postgres-Updating-unnecessary-columns/m-p/2418544#M9464</guid>
      <dc:creator>SushilKumar</dc:creator>
      <dc:date>2024-02-14T06:11:08Z</dc:date>
    </item>
  </channel>
</rss>

