Skip to main content

All Questions

Filter by
Sorted by
Tagged with
1 vote
2 answers
332 views

How do I rewrite my query to use less temporary space?

I'm using Postgres 9.5. I want to identify (and then delete) rows from my table that are "duplicates" in the sense that they contain three fields that are the same, namely my_object_id name ...
Dave's user avatar
  • 733
14 votes
1 answer
30k views

Index usage on a temporary table

I have two rather simple queries. The first query UPDATE mp_physical SET periodic_number = '' WHERE periodic_number is NULL; and it's plan duration: 0.125 ms plan: Query Text: UPDATE ...
Artem Zefirov's user avatar
0 votes
1 answer
2k views

TEMP table alternatives for pl/pgsql

I am trying to emulate MERGE behavior with pl/pgsql: -- Generate the data from funtion CREATE TEMP TABLE temp_x (id int, id2 int, data text, created_at timestamp, updated_at timestamp) ON COMMIT ...
J-16 SDiZ's user avatar
  • 327
6 votes
1 answer
11k views

Postgres 'could not write to hash-join temporary file: No space left on device'

I was getting this error a while ago and I was curious about two things - 1- How do the internals of postgres work that cause this message to occur in the first place? What is the hash-join in ...
nobody's user avatar
  • 183
1 vote
1 answer
735 views

Join external data in SELECT query

I have few (~20) names of products corresponding to an integer id that needs to be joined on products while exporting products data (using COPY (<query>) TO). The burden is that these names do ...
Ondřej Želazko's user avatar
3 votes
2 answers
386 views

Is copy/rename a good way to improve temp table performance?

An application I am working with contains this sequence of queries at the end of constructing a large temp table; I believe it is an attempt to improve performance by pruning dead tuples - create ...
gcbenison's user avatar
  • 135