Reg performance issues while passing the tableName as mybatis parameter

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Reg performance issues while passing the tableName as mybatis parameter

Anjali Selvaraj
Hello All, 
Hope you are being safe and well. 
I am using mybatis xml mapper for SQL Server. I am having a statement like 

<delete>
DELETE FROM ${tableName} where val = #{val}
</delete>

I want to know if it will cause any performance issues

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/mybatis-user/e18f4a77-4975-4b2c-b6dc-06378ddffa66n%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: Reg performance issues while passing the tableName as mybatis parameter

Guy Rouillier-2
Because the table name is being passed in dynamically, the DBMS will not be able to plan ahead.  So you'll encounter that penalty for dynamic SQL.  But if your "val" column is indexed, performance should be okay; if not, performance will suffer. 

--
Guy Rouillier

On 11/12/2020 3:18:50 PM, "Anjali Selvaraj" <[hidden email]> wrote:

Hello All, 
Hope you are being safe and well. 
I am using mybatis xml mapper for SQL Server. I am having a statement like 

<delete>
DELETE FROM ${tableName} where val = #{val}
</delete>

I want to know if it will cause any performance issues

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/mybatis-user/e18f4a77-4975-4b2c-b6dc-06378ddffa66n%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/mybatis-user/emdcc4328c-29c5-4257-a926-d1b804394fbf%40asus.