Skip to main content

All Questions

1 vote
0 answers
33 views

postgresql EXPLAIN gives seq scan rows = 12 for filter id < 10

I ran explain command on this query: EXPLAIN Select * from project_project where id < 10 FOR UPDATE And the plan output: "LockRows (cost=0.00..6.57 rows=12 width=18305)" " -> ...
Azima's user avatar
  • 4,033
1 vote
1 answer
96 views

How to get EXPLAIN output with a SELECT statement?

I'm trying to grab a query plan for my query. However, I do not have direct access to the db and can only run SELECT statements on my end. Is there a way to wrap SELECT around EXPLAIN, maybe even ...
Kamran Maharramli's user avatar
0 votes
1 answer
45 views

Why is this Postgresql UPDATE statement so slow even when it doesn't update any rows? [closed]

I see that a full table scan is planned, however it's never executed and the UPDATE takes a long time anyway. Why?? Here's the EXPLAIN output Update on public.hone_cohortuser (cost=3180.32..8951.51 ...
Marcos's user avatar
  • 1,335
1 vote
1 answer
84 views

Efficient many-to-many embedding comparisons

I am trying to recommend a user the top "articles" given embeddings of "interests" they have. Each "user" will have 5-10 embeddings associated with their profile, ...
user2779450's user avatar
0 votes
1 answer
137 views

How to get explain for a foreign table

I have a query that is essentially SELECT * FROM foreign_table_a LEFT JOIN local_table_b on foreign_table_a.id = local_table_b.id I'm looking at the explain analyse in datagrip and I don't really get ...
TreeWater's user avatar
  • 847
0 votes
1 answer
156 views

psql execution plan interpretation, Time spike compare to Cost (no spike)

could you help me to interpret a psql execution plan, i'm a java developer, rather then DB engineer and can't get the below. I have a big sql (the actual sql is not that important i guess), but it ...
Dmitriy Ten's user avatar
3 votes
2 answers
512 views

How do I get a PostgreSQL execution plan with parameters?

My application has a myriad of queries and I wanted to get the execution plan of some of them. Most if not all of the queries have multiple parameters and I can't find how to get the execution plan ...
Joe DiNottra's user avatar
0 votes
1 answer
75 views

How to understand expain analyze output for query?

I have this query in my database: INSERT INTO value2s(organization, location, device, measurement, timestamp, interval, average, ...
user000001's user avatar
2 votes
2 answers
246 views

Why is Postgres execution plan changing vastly based on where condition

I am trying to execute the same SQL but with different values for the where clause. One query is taking significantly longer time to process than the other. I have also observed that the execution ...
ananda's user avatar
  • 179
1 vote
1 answer
293 views

Why does the query planner start picking a worse plan after a certain number of joins inside a CTE?

I have the following query: EXPLAIN ANALYZE WITH up AS ( SELECT ua1.id ua1_id, gp1.id gp1_id, upai1.id upai1_id, upbi1.id upbi1_id, upiv1.id upiv1_id, vi.id vi_id, c.id ...
Daniel Rearden's user avatar
2 votes
2 answers
840 views

SQL Query Execution Plan Analyzer Tool [closed]

I am using RDS Aurora PostgreSQL and I am new in PostgreSQL. I have been trying to analyze Execution Plans for queries in PostgreSQL. I realized that manual audit on these plans take times, may need ...
ahmet gül's user avatar
2 votes
2 answers
147 views

Identical SELECT vs DELETE query creates different query plans with vastly different execution time

I am trying to speed up a delete query that appears to be very slow when compared to an identical select query: Slow delete query: https://explain.depesz.com/s/kkWJ delete from processed.token_utxo ...
adjuric's user avatar
  • 270
1 vote
1 answer
2k views

How to avoid performance degradation when run query with cast in where clause?

I have a table with 2 varchar columns (name and value) and I have such a query: select * from attribute where name = 'width' and cast( value as integer) > 12 This query works but I suppose there ...
gstackoverflow's user avatar
0 votes
1 answer
1k views

Postgres query cost is higher but runs faster

Update on 2022-05-15 After running vacuum analyze, the query plans are below. For A query Nested Loop Left Join (cost=45913.11..496597.16 rows=10 width=128) (actual time=115.205..3068.596 rows=10 ...
pjr's user avatar
  • 67
1 vote
1 answer
299 views

Why would LIMIT 2 queries work but LIMIT 1 always times out?

I'm using this public Postgres DB of NEAR protocol: https://github.com/near/near-indexer-for-explorer#shared-public-access postgres://public_readonly:[email protected]/...
Ryan's user avatar
  • 23.3k

15 30 50 per page
1
2 3 4 5 6