The final solution was/is much simpler. However, there is still a query speed advantage with PHP. A colleague ran the same queries, on the same model machine, using the same MySQL DB, and MySQL version, only difference was PHP and the query times were much, much faster. How much? Well, after optimizing (as indicated below), my query times are down to 0.0003 (3 MS) on average. Not bad at all. But the same query on PHP (again, PHP being the ONLY change) was taking less than 1 MS on average, usually about 0.00005 0.5MS). You can see the CF page here: The trick/key was to change the default index that came with the DB (data and schema). It was a PK index, clustered on ipTo and ipFrom, both INT (10) fields. That has been deleted and now, the index is simply on ipFrom. No other index, no PK. Then, instead of searching for a value on each side/end of the IPv4 number (a range), the query is now:
SELCT * FROM table WHERE ipFrom <= inet_aton('64.105.194.201') ORDER BY ipFrom DESC LIMIT 1 The limit tells MySQL to stop looking essentially. The order by forces us to get the right record. So, problem solved. And, as a test, i did 35,000 of these look ups, along with 35,000 DB updates to a second table in just under 33 seconds. Not bad at all. And while the query was faster in PHP, the actual output, the display of the page via CF/Apache and in the users browser, is much faster in CF than in PHP (in this case). _____________ Derrick Peavy Sales and Web Services Universal Advertising Phone: 404-786-5036 Fax: 404-370-0470 http://www.universaladvertising.com http://www.collegeadvertising.com http://www.collegeclassifieds.com ___________________________________ On Sep 7, 2006, at 10:08 PM, Cameron Childress wrote:
|
- Re: re[6]: [ACFUG Dis... Teddy Payne
- RE: re[6]: [ACFUG Dis... Rick Lansford
- re[8]: [ACFUG Discuss... Mischa Uppelschoten ext 10
- [ACFUG Discuss] Speed... Derrick Peavy
- Re: [ACFUG Discuss] S... Steven Ross
- Re: [ACFUG Discuss] S... Cameron Childress
- Re: [ACFUG Discuss] S... Dean H. Saxe
- Re: [ACFUG Discuss] S... Cameron Childress
- Re: Re: [ACFUG Discus... Steven Ross
- [ACFUG Discuss] Re: S... Cameron Childress
- *solved* Re: [ACFUG D... Derrick Peavy
- Re: *solved* Re: [ACF... Cameron Childress
- Re: *solved* Re: [ACF... Derrick Peavy
- RE: [ACFUG Discuss] RE: JRUN Hangs REDEUX Steve Drucker
- RE: [ACFUG Discuss] RE: JRUN Hangs REDEUX Robert Reil
- RE: [ACFUG Discuss] RE: JRUN Hangs REDEUX Shawn . Gorrell
- RE: [ACFUG Discuss] RE: JRUN Hangs REDEUX Cody Wehunt
- RE: [ACFUG Discuss] RE: JRUN Hangs REDEUX Robert Reil
- RE: [ACFUG Discuss] RE: JRUN Hangs REDEUX Dean H. Saxe
- RE: [ACFUG Discuss] RE: JRUN Hangs REDEUX Robert Reil
- RE: [ACFUG Discuss] RE: JRUN Hangs REDEUX Robert Reil