• Eshika (10/9/2013)


    Hi I am using Stuff with XML Path for concatenating the data in multiple columns like city, town etc by Zip code. ie., unique column is Zip and all the cities will be concatenated to one cell, similarly town and so on. The query runs over 1 million data, table has 180 columns.

    I tried -

    Adding indexes to the table, it took 50 minutes to run the query.

    Added a temporary table to get only required 20 columns and added indexes to the temporary table and it helped reduce about 3 minutes.

    Checked the execution plan the issue was with the table scan. There are no filters required to generate this report.

    Can you please suggest what else could be done to improve.

    Thanks

    Esha

    We need a LOT more details to offer much help. We would need to see the table with index definitions. The query you are running and the actual execution plan at a bare minimum.

    How to post Performance Problems[/url]

    _______________________________________________________________

    Need help? Help us help you.

    Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

    Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.

    Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
    Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
    Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
    Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/