code_junkie

PosgreSQL Query Optimization and the Postmaster Process'

Nov 13th, 2011
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. DELETE FROM pagelinks USING page WHERE pl_from NOT IN (page_id);
  2.  
  3. Nested Loop (cost=494640.60..112115531252189.59 rows=3953377028232000 width=6)
  4. Join Filter: ("outer".pl_from <> "inner".page_id)"
  5. -> Seq Scan on pagelinks (cost=0.00..5889791.00 rows=293392800 width=17)
  6. -> Materialize (cost=494640.60..708341.51 rows=13474691 width=11)
  7. -> Seq Scan on page (cost=0.00..402211.91 rows=13474691 width=11)
  8.  
  9. CREATE TABLE temp_to_delete AS(
  10. (SELECT DISTINCT pl_from FROM pagelinks)
  11. EXCEPT
  12. (SELECT page_id FROM page));
  13. DELETE FROM pagelinks USING temp_to_delete
  14. WHERE pagelinks.pl_from IN (temp_to_delete.pl_from);
  15.  
  16. Query returned successfully: 31340904 rows affected, 4415166 ms execution time.
Add Comment
Please, Sign In to add comment