Skip to main content

All Questions

0 votes
0 answers
473 views

Sudden drop in postgreSQL Memory

Version: 13.6 Hi , This is a 2 days old issue. Our Postgresql is hosted on AWS RDS Postgresql. Suddenly our free memory dropped from 1300 MB to 23 MB and swap memory increased from 150 mb to 12OO. MB. ...
Monika Yadav's user avatar
1 vote
1 answer
2k views

Postgres select query making sequential scan instead of index scan on table with 18 Million rows

I have a postgres table which has almost 18 Million rows and I am trying to run this query select * from answer where submission_id = 5 and deleted_at is NULL; There is an partial index on the table ...
Nikhil Ponduri's user avatar
3 votes
1 answer
2k views

Index skip scan emulation to retrieve distinct product IDs and min/max for additional columns

Here's my table schema: CREATE TABLE tickers ( product_id TEXT NOT NULL, trade_id INT NOT NULL, sequence BIGINT NOT NULL, time TIMESTAMPTZ NOT NULL, price NUMERIC NOT NULL, ...
user avatar
9 votes
1 answer
8k views

SELECT DISTINCT is slower than expected on my table in PostgreSQL

Here's my table schema: CREATE TABLE tickers ( product_id TEXT NOT NULL, trade_id INT NOT NULL, sequence BIGINT NOT NULL, time TIMESTAMPTZ, price NUMERIC NOT NULL, side TEXT ...
user avatar
2 votes
0 answers
279 views

PostgreSQL - citext perform than text for SELECT

There are mentions regarding the performance issues in citext data type in PostgreSQL.In PostgreSQL, weird issue about citext performance?. I wanted to measure actual performance difference in my ...
hddananjaya's user avatar
0 votes
2 answers
151 views

Postgres: Why did adding index slow down regexp queries?

I have a TEXT keyvalues column in Postgres: select * from test5 limit 5; id | keyvalues ----+------------------------------------------------------ 1 | ^ first 1 | second 3 ...
user124114's user avatar
  • 8,721
1 vote
2 answers
338 views

Simple yet slow SQL query with PostgreSQL

I have two tables I want to join: CREATE TABLE public."order" ( id uuid NOT NULL, side varchar(4) NOT NULL, product varchar(7) NOT NULL, price numeric(18,8) NOT NULL, close_time ...
LivingSilver94's user avatar
0 votes
1 answer
1k views

How does PostgreSQL deal with performance when having millions of entries

It may be a silly basic question but as described in the title, I am wondering how PostgreSQL deals with performance when having millions of entries (with the possibility of reaching a billion entries)...
Cyrille Dakhlia's user avatar
11 votes
2 answers
24k views

Slow nested loop left join with index scan 130k times in loop

I am really struggling to optimize this query: SELECT wins / (wins + COUNT(loosers.match_id) + 0.) winrate, wins + COUNT(loosers.match_id) matches, winners.winning_champion_one_id, winners....
Ferhat Sayan's user avatar
3 votes
2 answers
2k views

Does updating a row with the same value actually update the row?

I have a performance-related question. Let's say I have a user with the first name Michael. Take the following query: UPDATE users SET first_name = 'Michael' WHERE users.id = 123 Will the query ...
OneSneakyMofo's user avatar
10 votes
2 answers
15k views

Execute multiple functions together without losing performance

I have this process that has to make a series of queries, using pl/pgsql: --process: SELECT function1(); SELECT function2(); SELECT function3(); SELECT function4(); To be able to execute everything ...
francisco sollima's user avatar
0 votes
0 answers
59 views

Performance issue - Process postgres database

Good morning!  I have a web application connected to a postgres database in Ubuntu.  I have the problem that there is a process within my database which consumes 100% of the CPU time.  How can I ...
user4091160's user avatar
1 vote
1 answer
549 views

Performance of a Postgres query

I have following query, which I want to optimize. SELECT a.household_id household_id, age_of_youngest_woman, b.number_of_children, c.number_of_men, ...
Glory to Russia's user avatar
10 votes
3 answers
9k views

Optimization of count query for PostgreSQL

I have a table in postgresql that contains an array which is updated constantly. In my application i need to get the number of rows for which a specific parameter is not present in that array column. ...
jeruki's user avatar
  • 1,900
1 vote
2 answers
2k views

Postgres equivalent of MySQL's BENCHMARK() function

I am using Postgresql. I want to test how much time a function takes to execute. Since the function takes only a few milliseconds, I would like to call it in a loop 1000s of times to get an accurate ...
Dojo's user avatar
  • 5,704