Re: [EXTERNAL] Re: Support load balancing in libpq

From: Jelte Fennema <postgres(at)jeltef(dot)nl>
To: Andrey Borodin <amborodin86(at)gmail(dot)com>
Cc: Greg S <stark(dot)cfm(at)gmail(dot)com>, Jacob Champion <jchampion(at)timescale(dot)com>, Maxim Orlov <orlovmg(at)gmail(dot)com>, Jelte Fennema <Jelte(dot)Fennema(at)microsoft(dot)com>, Michael Banck <mbanck(at)gmx(dot)net>, Aleksander Alekseev <aleksander(at)timescale(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, Andres Freund <andres(at)anarazel(dot)de>
Subject: Re: [EXTERNAL] Re: Support load balancing in libpq
Date: 2023-03-03 14:37:55
Message-ID: CAGECzQQ8SgwLyNZ=jbZ_fJ6a8oKt_JSwX5MLnkq3N8FSuxyk-A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> I want to note that the Fisher-Yates algorithm is implemented in a
> difficult to understand manner.
> +if (j < i) /* avoid fetching undefined data if j=i */
> This stuff does not make sense in case of shuffling arrays inplace. It
> is important only for making a new copy of an array and only in
> languages that cannot access uninitialized values. I'd suggest just
> removing this line (in both cases).

Done. Also added another patch to remove the same check from another
place in the codebase where it is unnecessary.

Attachment Content-Type Size
v10-0003-Support-load-balancing-in-libpq.patch application/octet-stream 22.3 KB
v10-0002-Refactor-libpq-to-store-addrinfo-in-a-libpq-owne.patch application/octet-stream 11.5 KB
v10-0004-Remove-unnecessary-check-from-Fisher-Yates-imple.patch application/octet-stream 1.1 KB
v10-0001-libpq-Run-pgindent-after-a9e9a9f32b3.patch application/octet-stream 38.2 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2023-03-03 14:43:21 Re: Non-superuser subscription owners
Previous Message Önder Kalacı 2023-03-03 14:15:49 Re: [PATCH] Use indexes on the subscriber when REPLICA IDENTITY is full on the publisher