Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2009
    Posts
    1

    Unanswered: A join with very slow performance

    Hi

    I have a problem with a join between two tables: allocation and reclamo

    the primary keys on allocation table are two integer columns:

    ALLOCATION
    ______________________
    allocation_num | N
    allocation_item | N
    .
    .
    .



    the foreing key on reclamo is a character column:
    RECLAMO
    ______________________
    orden | C
    .
    .
    .

    At orden column have concatenated: allocation_num and allocation_item


    Iīm using the following join, but it is very slowly when I execute the query:

    rtrim(convert(char,dbo.allocation_item.alloc_num)) +"/"+convert(char,dbo.allocation_item.alloc_item_num) =dbo.reclamo.orden

  2. #2
    Join Date
    May 2005
    Location
    South Africa
    Posts
    1,365
    Provided Answers: 1
    Indexes cant be used when you use functions on the indexed columns.
    Change the table so you wont have to join on a concatenated value
    (normalize the table)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •