Skip to main content
added [query-performance] to 2412 questions - Shog9 (Id=1924)
Link
added 3 characters in body
Source Link
András Váczi
  • 31.6k
  • 13
  • 101
  • 149

But I guess I ahvehave so much data, the above query is dying with the below error:

THisThis is after pointing my temporary space (pgsql_tmppgsql_tmp directory) at a partition that gives it 20 GB of temp space. So my question is, how can I rewrite the above so tahtthat it does not use as much temp space? That is fine if it takes the query a really long time to run.

But I guess I ahve so much data, the above query is dying with the below error

THis is after pointing my temporary space (pgsql_tmp directory) at a partition that gives it 20 GB of temp space. So my question is, how can I rewrite the above so taht it does not use as much temp space? That is fine if it takes the query a really long time to run.

But I guess I have so much data, the above query is dying with the below error:

This is after pointing my temporary space (pgsql_tmp directory) at a partition that gives it 20 GB of temp space. So my question is, how can I rewrite the above so that it does not use as much temp space? That is fine if it takes the query a really long time to run.

It's Postgres not PostGres
Source Link
user1822
user1822

I'm using PostGresPostgres 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

select rt1.id, rt1.name  
FROM my_object_times rt1, 
     my_object_times rt2  
where rt1.my_object_id = rt2.my_object_id 
  and rt1.name = rt2.name 
  and rt1.time_in_ms = rt2.time_in_ms 
  and rt1.id > rt2.id;

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

select rt1.id, rt1.name FROM my_object_times rt1, my_object_times rt2 where rt1.my_object_id = rt2.my_object_id and rt1.name = rt2.name and rt1.time_in_ms = rt2.time_in_ms and rt1.id > rt2.id;

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

select rt1.id, rt1.name  
FROM my_object_times rt1, 
     my_object_times rt2  
where rt1.my_object_id = rt2.my_object_id 
  and rt1.name = rt2.name 
  and rt1.time_in_ms = rt2.time_in_ms 
  and rt1.id > rt2.id;
Source Link
Dave
  • 733
  • 10
  • 22
  • 38
Loading