0

I have 2 tables :

Table A 

ID int,
Name varchar,
Address varchar


Table B 

ID int,
Name varchar,
Address varchar,
Col1...
...
Col100

I want to update A.Name with B.Name based on both table's ID.

UPDATE A 
    SET A.NAME = B.NAME 
    FROM A JOIN (SELECT ID, Name from B) AS B ON A.ID = B.ID 

UPDATE A 
    SET A.NAME = B.NAME 
    FROM A JOIN B AS B ON A.ID = B.ID 

Because I don't have the permission to set the option for viewing execution plan, I ran 2 queries above many times and see the processed time to guess which one has better performance.

With about 700k records, both queries's result slightly differ.

So my question is, if executed, will both queries have the same execution plan? (I mean will the database engine process them by the same way? )

P/S : I'm using SybaseIQ 16.0.0.429

EagerToLearn
  • 101
  • 2
  • which Sybase product (ASE? SQLAnywhere? IQ? Advantage?) and version? – markp-fuso Dec 01 '17 at 02:55
  • @markp Thanks, I updated my question. Please take a look. – EagerToLearn Dec 01 '17 at 03:20
  • your easiest/quickest answer will likely come from your DBA ... either get the DBA to grant you permissions to see your execution plans, or get the DBA to provide the query plans for the queries in question – markp-fuso Dec 01 '17 at 18:32
  • You should have a test/dev instance in your shop! Get credentials on that! Maybe it's available for download for personal use? Most products are these days! – Vérace Dec 01 '17 at 18:37

0 Answers0