Questions tagged [postgres15]

4 questions
1
vote
1 answer

Google Cloud SQL cannot connect to Apache Superset

While trying to connect Apache Superset to Google Cloud SQL (PostgreSQL) I get this error: I also unsuccessfully tried to connect by SQLAlchemy URI string postgresql://username:password@host:port/database as well…
0
votes
0 answers

How to optimize complex sorting?

I'm building a language learning platform, here are some tables: create table users ( id bigserial primary key, ... ) create table users_languages ( id bigserial primary key, user_id …
Majesty
  • 2,097
  • 5
  • 24
  • 55
0
votes
2 answers

PostgreSQL: Combine two JSON objects into a single JSON object

I am using PostgreSQL 15 and have the following two statements in PL/pgSQL: -- Statement 1 SELECT to_json(T) FROM (SELECT * FROM category WHERE category.id = 43) T) -- Statement 2 SELECT json_build_object('products', JSON_AGG(T)) FROM (SELECT…
user1107173
  • 10,334
  • 16
  • 72
  • 117
-1
votes
3 answers

`row_number() over ()` causes drastically slow query only in Production and sort of fixes itself by upgrading from version 14.8 to 15

I have a new database with only about 225 rows. I was facing a slow query issue only on the postgres running in production on my Ubuntu server. It was reporting 423.460 ms for the execution time. The postgres on my development Mac wasn't having the…