Query Results too much for memory

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

  1. #1

    Default Query Results too much for memory

    I'm running a simple CFQUERY that returns 2 columns, an integer and a CLOB,
    from my table. I then write out the data to a file for downloading. The row
    count is getting rather large, sometimes over 200,000. When I watch the memory
    usage, I've seen it run incredibly large, in excess of 1GB. This has choked
    ColdFusion and locked up several associated sites, requiring a CF restart.

    As a temporary solution, I'm running a loop so it only returns x amount of
    rows at a time, depending on the amount of data that will be queried.
    Unfortunately if I run this query several times concurrently, usually around 5,
    I'll crash the server.

    Is there anyway for ColdFusion to store the queried data to disk rather than
    memory? Or does anyone have any optimization suggestions?

    Thank you!
    Jason

    naMwodahS Guest

  2. Similar Questions and Discussions

    1. Complex join = no results (for a query that shouldreturn results)
      I am trying to use a rather complex join that returns many results when the SQL server is queried directly, but returns no results when used on a...
    2. Query results don't display properly in results table.IGNORE PREVIOUS
      :disgust; I need to display the results of a query. The query runs properly. My problem is having specific results display in specific locations in...
    3. Query results don't display properly in results table.
      :disgust; I need to display the results of a query. The query runs properly. My problem is having specific results display in specific locations in...
    4. specifying query results
      Hi. I am currently implementing the dynamic interaction of Flash with a database for the first time. In the thing I am trying now, I am generating a...
    5. Getting too many results from a query!
      This is very peculiar -- for some reason, I'm getting 6-8 results from each of these queries, although only one listing matches. I have a pair of...
  3. #2

    Default Re: Query Results too much for memory

    I suppose that one way around this would be to break this into two queries. The
    first query might return only the primary key from your table ,based on all of
    the search criteria from your original "simple" query. Then, you would enclose
    your second query within a cfloop or cfoutput, where you would loop through
    your list of primary key values, one at a time, and perform the search for your
    three columns, then write the data out to the file for each row returned on
    each pass through the loop. Not very efficient nor fast, but it might prevent
    you from running out of memory. (I haven't tried this myself, so this is just
    speculation.)

    Phil

    paross1 Guest

  4. #3

    Default Re: Query Results too much for memory

    Well I finally figured out the problem. After much headaches, I did some
    searching and found [url]http://www.bpurcell.org/blog/index.cfm?mode=entry&entry=988[/url]
    to determine what version of the driver you are running.

    Stay safe and keep your drivers updated!

    Thanks for your suggestions!

    Jason

    naMwodahS 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