Re: Alignment check

2024-06-27 Thread Adrian Klaver
On 6/27/24 10:26, Marthin Laubscher wrote: On 2024/06/27, 19:04, "Adrian Klaver" mailto:adrian.kla...@aklaver.com>> wrote: And substituted a single platform dependence. Even bare metal can lock you in without some abstraction layer between your code and the hardware. It's true that Kubernetes

Re: Alignment check

2024-06-27 Thread Ron Johnson
On Thu, Jun 27, 2024 at 1:26 PM Marthin Laubscher wrote: [snip] > So when you're done trolling me and my choices, Adrian didn't start this "conversation". > feel free to comment on the actual question. > YB says they are almost finished updating their system to the PG 15 (not sure which poin

Re: Alignment check

2024-06-27 Thread Marthin Laubscher
On 2024/06/27, 19:04, "Adrian Klaver" mailto:adrian.kla...@aklaver.com>> wrote: > And substituted a single platform dependence. Even bare metal can lock you in without some abstraction layer between your code and the hardware. It's true that Kubernetes is a "single platform" but it provides the

Re: dblink Future support vs FDW

2024-06-27 Thread Adrian Klaver
On 6/27/24 08:32, Dhritman Roy wrote: Hello, This is my attempt to seek support at PostGreSQL. I know we can use FDW but our teams are right now considering dblink ( it seems it is more performant when compared to FDW ) and we obviously do not want to end up in a situation where we develop so

Re: Alignment check

2024-06-27 Thread Adrian Klaver
On 6/27/24 09:07, Marthin Laubscher wrote: Hi, I don’t intend dissing or plugging anyone’s efforts or start a flame war, but I’d like to get a sense of how the PostgreSQL community feels about: a) YugabyteDB, and b) PostgreSQL on Kubernetes. For my application I’m deeply vested in Kubernetes

Re: A way to optimize sql about the last temporary-related row

2024-06-27 Thread David Rowley
On Fri, 28 Jun 2024, 3:20 am aghart...@gmail.com, wrote: > > Now the query: > explain (verbose, buffers, analyze) > with last_table_ids as materialized( >select xx from ( >select LAST_VALUE(pk_id) over (partition by integer_field_2 order by > datetime_field_1 RANGE BETWEEN UNBOUNDED PRECE

Alignment check

2024-06-27 Thread Marthin Laubscher
Hi, I don’t intend dissing or plugging anyone’s efforts or start a flame war, but I’d like to get a sense of how the PostgreSQL community feels about: a) YugabyteDB, and b) PostgreSQL on Kubernetes. For my application I’m deeply vested in Kubernetes as a pathway to being cloud-agnostic and I ha

Re: dblink Future support vs FDW

2024-06-27 Thread Tom Lane
Dhritman Roy writes: > My organization is building something which is using dblink and what we are > building shall take several months and then to be offered to a client. > I just wanted to check what is the future/roadmap of dblink? > Is it going to be obsolete/removed from PostGreSQL in upcomi

Re: A way to optimize sql about the last temporary-related row

2024-06-27 Thread aghart...@gmail.com
Hi, Thanks for you reply. About syntax you're right, but I couldn't think of anything better :(((  I'm here for that too, to solve the problem in a fancy way, with your great support. In practice, I need to get back a dataset with the last association (the most datatime recent record) for a

Re: dblink Future support vs FDW

2024-06-27 Thread David G. Johnston
On Thursday, June 27, 2024, Dhritman Roy wrote: > > This is my attempt to seek support at PostGreSQL.So, if I have broken any > protocols/rules or violated any code of conduct then please do forgive and > guide me. Thanks. > > The G is not capitalized. > I know we can use FDW but our teams are r

Re: A way to optimize sql about the last temporary-related row

2024-06-27 Thread Ron Johnson
On Thu, Jun 27, 2024 at 11:33 AM aghart...@gmail.com wrote: > Hi, > > You are right. Too quickly copy-paste on my part :-) > > I take this opportunity to add a NOT insignificant detail. > > Before executing the select query I clear the cache: > > systemctl stop postgresql-16 && sync && echo 3 > /

Re: A way to optimize sql about the last temporary-related row

2024-06-27 Thread David G. Johnston
On Thursday, June 27, 2024, aghart...@gmail.com wrote: > > Now the query: > explain (verbose, buffers, analyze) > with last_table_ids as materialized( > select xx from ( > select LAST_VALUE(pk_id) over (partition by integer_field_2 order by > datetime_field_1 RANGE BETWEEN UNBOUNDED PRECEDING

Re: A way to optimize sql about the last temporary-related row

2024-06-27 Thread aghart...@gmail.com
Hi, You are right. Too quickly copy-paste on my part :-) I take this opportunity to add a NOT insignificant detail. Before executing the select query I clear the cache: systemctl stop postgresql-16 && sync && echo 3 > /proc/sys/vm/drop_caches  &&  systemctl start postgresql-16 I need to get

dblink Future support vs FDW

2024-06-27 Thread Dhritman Roy
Hello, This is my attempt to seek support at PostGreSQL. So, if I have broken any protocols/rules or violated any code of conduct then please do forgive and guide me. Thanks. My organization is building something which is using dblink and what we are building shall take several months and then

Re: A way to optimize sql about the last temporary-related row

2024-06-27 Thread Ron Johnson
On Thu, Jun 27, 2024 at 11:20 AM aghart...@gmail.com wrote: [snip] > -- insert 4M records > insert into test_table(pk_id) select generate_series(1,400,1); > > -- now set some random data, distribuited between specific ranges (as in > my production table) > update test_table set > datetime_fie

A way to optimize sql about the last temporary-related row

2024-06-27 Thread aghart...@gmail.com
Hello everyone, Sorry to bother you but I have a query that is driving me crazy. I need to have the last valid record at a temporal level according to a specific parameter. First some data: Linux Rocky 8.10 environment, minimal installation (on VM KVM with Fedora 40). Postgresql 16.3, instal

Re: Can any_value be used like first_value in an aggregate?

2024-06-27 Thread Bruno Wolff III
On Wed, Jun 26, 2024 at 09:50:59 +0200, Laurenz Albe wrote: On Tue, 2024-06-25 at 14:11 -0500, Bruno Wolff III wrote: The actual use case is a set of tripplets returned from a query, where I want on row for each distinct value in the first column, paired with the value in the second column, fo