dbTalk Databases Forums  

Update inner join

comp.databases.postgresql comp.databases.postgresql


Discuss Update inner join in the comp.databases.postgresql forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Paolo Holzl
 
Posts: n/a

Default Update inner join - 03-18-2008 , 05:20 AM






In SQL Server is it possible to create an update inner join
without use of slow IN or EXIST.

In postgresql is it possible?

--


Reply With Quote
  #2  
Old   
Paolo Holzl
 
Posts: n/a

Default Re: Update inner join - 03-18-2008 , 07:24 AM






Paolo Holzl wrote:

Quote:
In SQL Server is it possible to create an update inner join
without use of slow IN or EXIST.
In postgresql is it possible?
using also a subselect il slow.

Example

update Tab1 b set FieldToUpdate = a.OtherField where exists
(select a.Key, a2.key from a
where a.key=b.key and a.key2=b.key2)

work but is slow

--



Reply With Quote
  #3  
Old   
Paolo Holzl
 
Posts: n/a

Default Re: Update inner join - 03-18-2008 , 07:24 AM



Paolo Holzl wrote:

Quote:
In SQL Server is it possible to create an update inner join
without use of slow IN or EXIST.
In postgresql is it possible?
using also a subselect il slow.

Example

update Tab1 b set FieldToUpdate = a.OtherField where exists
(select a.Key, a2.key from a
where a.key=b.key and a.key2=b.key2)

work but is slow

--



Reply With Quote
  #4  
Old   
Paolo Holzl
 
Posts: n/a

Default Re: Update inner join - 03-18-2008 , 07:24 AM



Paolo Holzl wrote:

Quote:
In SQL Server is it possible to create an update inner join
without use of slow IN or EXIST.
In postgresql is it possible?
using also a subselect il slow.

Example

update Tab1 b set FieldToUpdate = a.OtherField where exists
(select a.Key, a2.key from a
where a.key=b.key and a.key2=b.key2)

work but is slow

--



Reply With Quote
  #5  
Old   
Paolo Holzl
 
Posts: n/a

Default Re: Update inner join - 03-18-2008 , 07:24 AM



Paolo Holzl wrote:

Quote:
In SQL Server is it possible to create an update inner join
without use of slow IN or EXIST.
In postgresql is it possible?
using also a subselect il slow.

Example

update Tab1 b set FieldToUpdate = a.OtherField where exists
(select a.Key, a2.key from a
where a.key=b.key and a.key2=b.key2)

work but is slow

--



Reply With Quote
  #6  
Old   
Paolo Holzl
 
Posts: n/a

Default Re: Update inner join - 03-18-2008 , 07:24 AM



Paolo Holzl wrote:

Quote:
In SQL Server is it possible to create an update inner join
without use of slow IN or EXIST.
In postgresql is it possible?
using also a subselect il slow.

Example

update Tab1 b set FieldToUpdate = a.OtherField where exists
(select a.Key, a2.key from a
where a.key=b.key and a.key2=b.key2)

work but is slow

--



Reply With Quote
  #7  
Old   
Paolo Holzl
 
Posts: n/a

Default Re: Update inner join - 03-18-2008 , 07:24 AM



Paolo Holzl wrote:

Quote:
In SQL Server is it possible to create an update inner join
without use of slow IN or EXIST.
In postgresql is it possible?
using also a subselect il slow.

Example

update Tab1 b set FieldToUpdate = a.OtherField where exists
(select a.Key, a2.key from a
where a.key=b.key and a.key2=b.key2)

work but is slow

--



Reply With Quote
  #8  
Old   
Paolo Holzl
 
Posts: n/a

Default Re: Update inner join - 03-18-2008 , 07:24 AM



Paolo Holzl wrote:

Quote:
In SQL Server is it possible to create an update inner join
without use of slow IN or EXIST.
In postgresql is it possible?
using also a subselect il slow.

Example

update Tab1 b set FieldToUpdate = a.OtherField where exists
(select a.Key, a2.key from a
where a.key=b.key and a.key2=b.key2)

work but is slow

--



Reply With Quote
  #9  
Old   
Paolo Holzl
 
Posts: n/a

Default Re: Update inner join - 03-18-2008 , 07:24 AM



Paolo Holzl wrote:

Quote:
In SQL Server is it possible to create an update inner join
without use of slow IN or EXIST.
In postgresql is it possible?
using also a subselect il slow.

Example

update Tab1 b set FieldToUpdate = a.OtherField where exists
(select a.Key, a2.key from a
where a.key=b.key and a.key2=b.key2)

work but is slow

--



Reply With Quote
  #10  
Old   
Andreas Kretschmer
 
Posts: n/a

Default Re: Update inner join - 03-18-2008 , 07:46 AM



begin Paolo Holzl schrieb:
Quote:
Paolo Holzl wrote:

In SQL Server is it possible to create an update inner join
without use of slow IN or EXIST.
In postgresql is it possible?

using also a subselect il slow.

Example

update Tab1 b set FieldToUpdate = a.OtherField where exists
(select a.Key, a2.key from a
where a.key=b.key and a.key2=b.key2)
wrong syntax. Please show us a correct example and ...

Quote:
work but is slow
show us the output generated from explain analyse <your query>.

My guess: you haven't proper indexes.



end
Andreas
--
Andreas Kretschmer
Linux - weil ich es mir wert bin!
GnuPG-ID 0x3FFF606C http://wwwkeys.de.pgp.net


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.