home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.databases.ms-sqlserver      Notorious Rube Goldberg contraption      19,505 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 17,514 of 19,505   
   Jens Riedel to All   
   Problem with DELETE statement   
   29 May 09 13:27:13   
   
   From: JensRie@gmx.de   
      
   Hello,   
      
   currently I use the following SQL statement to delete all data from   
   table A which have a reference in table B:   
      
   delete   
   from table_a   
   where id in (select b_id from table_b where type = 'x')   
      
   This works fine, but currently I have only very small result sets for   
   the subquery.   
   I'm concerned now that if the subquery delivers a very big result set   
   the "IN" operator will make the whole statement execution very slow.   
      
   Can I change the delete statement that way that it is working with   
   better performance for big amounts of data?   
      
   Best regards   
   Jens   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca