note
edoc
</p>Maybe you need to think about the problem a bit differently. My last big a-ha! moment was when I realised I'd designed my database for data storage when what I should have been doing is designing it for data retrieval..</p>
<p>It sounds like you want to be able to do a query something like:</p>
<p>select room from search_table where max_capacity >= ? and pack_guests >= ? and pack_guests <= ? and valued_guest=? and agent=? and referral=?</p>
<p>The idea is to turn things around so instead of trying to apply a set of rules to a table of data you put the rules in a table and use it to look up the data.</p>
<p>In my case I was trying to process orders taking into account available stock, order payment, dispatch option selected by customer etc, etc. So to do a search for orders ready to be processed there were lots of lookups and calculating here there and everywhere to collect all the data needed for each order. I re-organised the order data so each order record had everything I needed and allowed me to do a single (although not simple) query to get all the orders ready to be processed. Once I had the data laid out correctly the database could easily and quickly process the query.</p>
<p>On the database config side of things.. have you modified your mysql config to allow it to use as much memory as you think it has available? <a href="http://dev.mysql.com/doc/refman/4.1/en/server-parameters.html">Tuning Server Parameters</a></p>
<!-- Node text goes above. Div tags should contain sig only -->
<div class="pmsig"><div class="pmsig-255317">
<p>cheers,</p>
<p>J</p>
</div></div>
514748
514748