in reply to Re: Clean Code - What a mess...
in thread Clean Code - What a mess...

This application sees about 200,000 lines of input per day, so you think that is it? Tha cache is just getting to be too much?

Replies are listed 'Best First'.
Re: Re: Re: Clean Code - What a mess...
by runrig (Abbot) on Nov 29, 2001 at 04:31 UTC
    The way that prepare_cached works is that it uses your entire SQL statement as the key to a hash (the value is the statement handle). So if statements differ in any way (even whitespace), then you are storing another key/value pair in the statement cache (and the database creates another cursor if the database supports cursors). With 200,000 lines of input and no placeholders in sight, you are abusing prepare_cached and are wasting memory. If you use placeholders, then the only difference in your cached statements will be the table names, and you shouldn't run out of memory (assuming there aren't too many table names).