Performing 500,000 inserts on 1 request

Ask a Question related to Coldfusion Database Access, Design and Development.

  1. #1

    Default Performing 500,000 inserts on 1 request

    HI, I need to take a CSV file and stick it in a MS sql server 2000 database.
    The file has 4 column and is over 500,000 lines long. I Got a nifty parser
    that uses java out of the code exmaples that came with CF. I simply added a UDF
    with a stored proc that inserts the params into the database. Now without
    invokeing the UDF the java/cf can parse the entire 500,000 lines in about 10
    seconds, add in the query and it still not bad, manageing about 1000 records
    per second...that is up untill its over 400,000 records, then it starts to get
    slower and slower untill it just stops at about 449,000 aaag!

    Im pretty sure the reason is because CF is caching the statusCode and
    ExecutionTime for every single query (if you run with debugging on the server
    you will end up with all the queries outputed at the bottom). Is there anyway
    to suppress this completely so cold fusion just forgets that it ever did the
    query at all?

    Ive got the wholw thing fairly silenced and its flushing the cache ever 1000
    lines along with a count of the row its on. Im not sure how to get it to run
    much faster without just ditching cf entirely and doing it all in java or a DTS.

    Ryan Bergman Guest

  2. Similar Questions and Discussions

    1. Firefox and IE performing differently
      We are creating a new site for our new Bed and Breakfast in Victoria BC and I am copying many of the Toronto pages over to the new domain, to get it...
    2. Illustrator quits when performing move
      OK - I have read through every thread that I could find relating to Illustrator crashing. I have deleted all preferences that I could find and have...
    3. Mail performing modules comparison
      Hello there! I am finding as best as possible perl module for performing e-mail on the mail server. The main goal is a web-interface for mail...
    4. Performing a FIND over multiple fields?
      Is there anyway to perform a find on multiple fields? I'm keeping, at works, a list of all the used photographic equipment that we did purchased...
    5. Performing Freehand MX Full Uninstall
      Hi I've been having problems with FHMX on Windows so decided to reinstall the program. However it obviously didn't perform a full uninstall as...
  3. #2

    Default Re: Performing 500,000 inserts on 1 request

    Got a question. Is this import of records a common occurance? or is it
    occasionally? I find it a heck of alot simpler and faster to just import the
    records into the database manualy or with a frontend, depending on the sql
    server. Using CF in this aspect seems to me like a waste of time and overhead,
    not to mention another place for something to go wrong in such a simple
    process. Unless the goal is for the end users to do this themselves. just my 2
    cents.

    rmorgan Guest

  4. #3

    Default Re: Performing 500,000 inserts on 1 request

    I doubt it keeps coldfusion from recording the information but you should
    certainly try disabling the output (see attached code) to see if that helps.
    Just throw cfsetting above the beginning of your template to ensure it doesnt
    render the debug information. Sorry I can't be of more help on this but I know
    if it were me I would be putting my eggs in the DTS route as its going to be a
    heck of a lot faster.

    Also do you have access to the server? Try monitoring memory use as the
    template processes? One thing I might look at is the JVM heap which seems to
    do much better when you dedicate a set amount of memory to CF that is to say
    make the minimum heap and max heap the same. I have done this in production
    enviornments where CF was on its own machine but this could be detrimental to
    performance if your running other services on the box with CF (provided you
    give CF to much memory). As I recall when I did this last I gave CF to much
    memory and it jacked up the service and it wouldnt load anymore, I believe the
    limit was 1.8 gb but that might have only been for 6.1.

    See: [url]http://www.macromedia.com/cfusion/knowledgebase/index.cfm?id=tn_19359[/url]

    I hope this helps but I get the feeling the second suggestion is the only one
    likely to effect it in any respect.

    <cfsetting showdebugoutput="no">

    TagTurner Guest

  5. #4

    Default Re: Performing 500,000 inserts on 1 request

    To answer the first reply it is a common occurance unfortunatly. And the reason
    I wanted to keep it in CF rather than writeing a DTS is because I needed to do
    several other file manipulation processes that needed to talk to the
    surrounding application.

    I've found a solution though. apparently you can create a linkserver out of a
    directory and then interact with text files in that directory as tables. Its
    wicked fast and I can put the commands in the stored proc and then just execute
    from CF.

    The tutorial I found was here:
    [url]http://www.users.drew.edu/skass/sql/TextDriver.htm[/url]

    it doesnt mention this but I needed to modify the permissions of my link
    server like this:
    EXEC sp_addlinkedsrvlogin 'txtsrv',
    'false',NULL,'ADMIN',NULL



    Ryan Bergman Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139