Null vs. Not Null (Varchar) field RRS feed

  • Question

  • User-582711651 posted


    Anyone, please help me,

    in my SQL table, I have a Varchar null field which connects another one child table. When I execute SP, output comes 10 to 15 mins delayed

    is the delay will get reduced? in-case I change null to not null?

    pls advice  

    Thursday, February 7, 2019 8:07 AM

All replies

  • User753101303 posted


    I really doubt about that. If null you are not supposed to join this row to another one anyway ? It would be best to take the time to understand what happens. You are producing a huge amount of rows? The fk column have an index ? If SQL Server you can use "show plan" to better understand how the query is processed and why it is slow.

    Ah and you could try sp_recompile : https://docs.microsoft.com/en-us/sql/relational-databases/stored-procedures/recompile-a-stored-procedure?view=sql-server-2017

    Thursday, February 7, 2019 8:55 AM
  • User-595703101 posted

    Maybe it is better to share the SP query so we can give more info about the join conditions

    Thursday, February 7, 2019 10:16 AM
  • User-1174608757 posted

    Hi ayyappan.CNN,

    According to your description, Could you please post the details about your sp query?It will help us to find out the reason for delay. 

    Best Regards

    Wei Zhang

    Friday, February 8, 2019 6:40 AM