MySQL Truncate slow performance problems
Comments:
My solution to this can be found here.
Programming, PHP, JavaScript, .Net, motorbikes, pubs, poker, football, news, restaurants and anything else
My solution to this can be found here.
We arrived half hour early and sat for a drink at the bar. There's a relaxed feel to the place and a slow trickle of people coming in through the door filling up the restaurant. Once our drinks were finished it took nothing more than hopping off our stools and a glance at the waitress for her to show us straight to our table. This was certainly impressive attention to customers, especially given that there only seemed to be two waiting staff for the 30 or 40 seats in the restaurant.
Service throughout was also excellent. We weren't hurried at any point, if we asked for a couple of minutes to decide on something then we would be left alone and, importantly, someone would come back to see to us a few minutes later. There were no large gaps between courses (unless we felt we needed the rest) and despite time being shared between the two staff they obviously kept in touch with who had ordered what dish so there was no need to ask as they brought food to the table.
The food was very good too. Throughout the three courses on the menu there is a variation from the more conservative to more adventurous modern european food, including (on the night we visited) steak, duck breast and risotto, and prawn and crab ravioli. Each course was well presented and richly flavoured yet somehow had a lightness of touch as the different tastes balanced each other.
The only possible downside was I felt that the winelist was slightly on the expensive side (ranging from around £12 upwards), although that seems to be par for the course nowadays. The wine itself (a Rioja Blanco) was good, however, so there has obviously been some thought put into the selection. Price-wise we came in at just over £40 a head, including a decent tip, which for three courses, wine, water and coffee seemed fair. In fact, given the prices of some London restaurants it's very good value for money.
Clerkenwell has certainly changed over the past few years. When I first worked there back in 1998 you certainly wouldn't think of going there on a Saturday evening on the off-chance of a good restaurant being open. Clerkenwell has been transformed into a trendy night-spot (albeit a slightly exclusive one) and, along with most of the other good restaurants in the area, booking is advised for Vic Naylor's.
Address: 38-40 St John Street, London, EC1M 4AY
Nearest tube: Farringdon
Other reviews:
Vic Naylor's on London Eating
Vic Naylor's on London Eats
I found this useful resource on restaurants and takeaways in South London - http://www.lacartes.com, it features over 1000 restaurants and takeaways each with menus and photos. You can search by distance, price and cuisines which makes it very easy to compare dishes and prices. Very easy to use.
Now the team is doing fairly well, and our defence and midfield are doing very well, but we're still having trouble with consistent goalscorers. Beattie started the season well but Southampton don't seem to be on the move (expect downwards) so I'm in two minds about him. Both Anelka and Hasselbaink have had spurts of scoring well, but we're still not getting the striking points we need. Suggestions welcome...
If you are interested there's lots of info about fantasy football here
http://www.footballweb.co.uk
In terms of speed, I certainly wasn't disappointed. I took it fairly easy on the throttle to start with but after half hour or so of riding I felt like the full range of power was easily controllable.
Out on the open road the Fazer does have pretty good acceleration. I know it's not up there with a CBR 600 or an R6 but compared to most other traffic on the road it's more than lively enough. The power band is not as even as I would have liked, though, with a big kick at higher revs. Perhaps if I gave it another go it wouldn't seem so bad but it was something I had to watch out for for a while.
The riding position is reasonably upright. Although this makes it fairly comfortable as a sitting position, the faring is quite minimal and the amount of wind certainly gives you some neck strain after an hour or two. I'd say the almost complete lack of protection the faring gives is the lowest point of this bike overall.
The pillion passenger was pretty comfortable, though: enough so to fall asleep going along the motorway! The other great thing about this bike is it's fuel range: I got more than 175 miles out with two people and luggage, and the fuel tank tells you exactly where you are. This is certainly worth considering with a bike: a CBR 600 needs a fill up about every 120 miles in the same conditions.
All in all, it was a pretty good bike but perhaps a bit too much between stools for me. The riding position wasn't racey and neither is the throttle, but the narrower power bands and lack of faring also don't push it anywhere near the touring bracket. Where this bike would be ideal is as a commuter, with it's good tank range, comfortable riding position and some good bursts of power for overtaking.
I did like the Fazer, and I think one day I'll have another go (the R6 just looks a bit too raw) but I think the real crux is that it's a class of bike that isn't quite for me.
I would in the main agree, I too have returned to biking after a 10 year break. For touring an aftermarket double double would may be do the trick. the bike is certainly in my opinion capable of touring
The pub itself is split into two parts: the bar, and the restaurant. Both are nicely fitted out in a kind of modern-rustic way and it manages to pull this all off without appearing to try too hard.
Our experience went downhill as soon as we asked if we could sit in the (almost completely empty) restaurant half: "As long as you're going to eat.". We said we were waiting for friends, and they agreed to give us a whole 40 minutes before we had to order. 10 minutes later, we were asked again if we were ready to order and had to remind them that we were waiting for more people. The friends arrived, but then we had to run the gauntlet of trying to attract a waiters attention; it was puzzling that after so much harrassment earlier we were actually finding it difficult.
The food was very good when it arrived, although hardly service with a smile. Again, attracting someone's attention for another bottle of wine was an ordeal. The meal/drinks came to around £25 a head in the end, which I don't see is a sum to be sniffed at by a pub/restaurant on a Thursday evening, and although The Duke of York has a very good quality food and a well thought out eating area, the feeling that we were imposing on the staff left us with no desire to return again.
The Duke's website: http://www.dukepub.co.uk
Another review: The Duke review on London Eating
today i found two nice things first a nice blog here and another a nice restaurant in london, of delicious cuisine where you can found out indian, chinense, manchurian, french, italian takeaways at http://www.lacartes.com/
First impression was odd: the engine chugs away like a car that's on the verge of misfiring, but open up the throttle from virtually any revs and away it goes! The linked brakes took no time at all to get used to: pull the brake, the bike stops. Easy.
On the open road the VFR is a very comfortable and very easy ride. The problem for me was it was a bit too easy to ride. The power band is fairly constant, although when all cylinders kick in above 7000rpm there is noticably more pull, but somehow, for me, that takes the fun out of riding a bike. I prefer the ride of the CBR 600 that will pull reasonably well at low-ish revs but really lets rip further up the band.
My other gripe with the VFR is the size and weight. It handles well once you're up to speed but I never felt as confident in the front tyre as I have on other bikes. I think this may have something to do with the slightly more upright riding position and being seated slightly further back than on a CBR. Or it could just be me. I do know that I managed to lock up a front wheel when a pheasant ran out into the middle of the road and that's never happened to me on any other bike.
In terms of the 'technical' aspects: torque was very impressive, speed was okay, but again I wasn't impressed by the mileage. My main (possibly only) problem with the CBR 600 is the size of the tank, but I could only get a few more miles out of the VFR and it didn't seem to provide any extra speed considering the petrol consumption.
From a pillion's point of view (I was told) it doesn't feel as solid. Again, I think that may be a combination of height and riding position, but pulling down a straight left my passenger feeling like they were going to tip off the back of the bike. This has never happened on a CBR 600 before and I've certainly never held back. Perhaps speed is all about perception and I've never managed to pull away as quickly on a CBR with a passenger before; the VFR certainly didn't seem to notice the extra weight in the same way.
All in all: Honda's VFR 800 is a good bike, but I don't think it's for me. I think my main problems are the size of the bike and slightly more upright riding position. Although the through-the-range power was good, I prefer something that you have to push a bit harder but rewards the effort with responsiveness and a nimble road poise.
Hey Karl,
I like your reviews on motorbikes, but can you please say of what year the bike is? That is ipmortant for a review so readers know exactly what bike you are talking about.
Thanks
And keep up the good work ;)
Stefaan
That's a good point. To be honest: I'm not sure what year the bike was manufactured in but I rode it in 2004 and it was new - which I guess makes it the 2002 6th generation model. It was the one without antilock brakes.
More info about the Standard PHP Library can be found here: Standard PHP Library with a link to download a windows chm help file for reference.
What I have found, though, is that LOAD DATA INFILE with REPLACE appears to try to delete the row and then re-insert it. This breaks other foreign constraints and so the database engine won't let it. Fair enough, but it would have been nice if the manual mentioned it.
So: next step is to disable the foreign keys temporarily with SET FOREIGN_KEY_CHECKS=0. From the command line this works fine, but it seems that within PHP the foreign key checks are re-enabled automatically after each command is run, which means the net result of running SET FOREIGN_KEY_CHECKS=0 is absolutely nothing. So when I try and to the LOAD DATA INFILE the constraints are still there and it doesn't work.
If we trusted MySQL 5 fully yet (and wanted to go through the pain of installing it) I could probably write a stored procedure, with whatever headaches that would bring, but as it is I'm stuck with MySQL 4 for the moment. The solution I've come up with is to write the SQL query to a text file and then use an exec() command from within PHP to execute the commands in the file. I don't like it, and it doesn't feel very portable, but it seems to work. In fact, it seems so handy that I've created a static method so I can do it with any batch of SQL queries.
The handy class follows (with constants in place of the database names/connection values/temporary folder):
public static function multipleDbQueries($sql)
{
$file = fopen(TEMP_CSV_LOCATION .
"temp_query.sql","a+");
fwrite($file,$sql);
fclose($file);
exec("mysql -u " . DB_USERNAME .
" --password=='" . DB_PASSWORD .
"' " . DB_NAME . " < "
. TEMP_CSV_LOCATION . "temp_query.sql");
}
Tim in T.O. -
Your solution is helpful; however, I put it in my code and then realized there's a big disconnect between using a DSN as best-practice in my application and then somehow providing username/password for this. Argh! Mysql doesn't know anything about DSNs. So I'll have to hard-code in a new password for the DB, all so I can do a runtime REPLACE which, as you observed, can't handle a foreign key reference.
I'd definitely be interested in finding something a bit closer, though, but East London doesn't seem particularly well served by motorbike hire.
Riverside Motor bike hire Unit 12 Dyehouse Lane, Bow E3 0208 5510221 does cheap and very good quality bike hire
the number above is not correct, but the following links provide alternative contacts for motorbike hire in London and beyond.
I know of these rental places:
In London:
http://www.superbikehire.co.uk/
http://www.raceways.net/
http://www.abouttownbikehire.co.uk/home.htm
In Wales:
http://www.timeless-touring.com/
In Barcelona:
http://www.catalansportsbikes.com/
I rent motorcycles in France - any of the following web addresses may be useful -
www.missionmotos.biz
www.we-rent-motorcycles.com
www.motopyrenees.com - ride ideas.
Si on est Francophone:
www.missionmotos.com
www.location-motos-france.com
www.scooter-sos.com
vous aider
Kind Regards Bill Shw
London based Internet development company seeks permanent ASP.NET developer with an absolute minimum of 1.5 years production experience.
Desktop application programming and web services experience are a must as is extensive VB.NET and SQL Server 2000 knowledge. 'Can-do' attitude, a problem ownership mindset, excellent common sense and the ability to communicate clearly to internal and external clients are also pre-requisites.
Exposure to SOAP and programming languages such as C#, XSL and PHP would be a distinct advantage.
This is an excellent opportunity to join an ambitious, young and profitable business at the beginning of an exciting growth phase.
No agencies.
Email: asp dot net at exponetic.com
class ParentObject()
{
protected $childObject;
function __construct()
{
$this->childObject = new ChildObject($this);
}
}
class ChildObject()
{
protected $parentObject;
//Pass in a reference to the parent
//object and store it internally
function __construct($parentObject)
{
$this->parentObject = $parentObject;
}
}
Then if I call $foo = new ParentObject(); then it automatically creates a child object with a reference to the parent. The parent also keeps a reference to its child. If I then unset($foo); the two objects are still referencing each other and so are not deleted. The only way I've found to clear this is to create a new method (which I call destroy()) to delete references to the child. Calling destroy() on the parent first calls destroy() on its child, which dereferences the parent, and then the parent dereferences the child. So the classes are now:
class ParentObject()
{
protected $childObject;
function __construct()
{
$this->childObject = new ChildObject($this);
}
public function destroy()
{
$this->childObject->destroy();
unset($this->childObject);
}
}
class ChildObject()
{
protected $parentObject;
//Pass in a reference to the parent object
//and store it internally
function __construct($parentObject)
{
$this->parentObject = $parentObject;
}
public function destroy()
{
unset($this->parentObject);
}
}
And I have to call
$foo->destroy(); unset($foo);
To clear the thing out completely. This can cause a number of problems which I won't go into in detail here (they occur in more complex design patterns), but suffice to say that there are a number of occassions where I don't necessarily want to destroy a child at the same time as a parent, or vice-versa. E.g. a child references multiple parents. The end result is that I'm writing code to deal with garbage collection where it is having a big effect on memory and just leaving it out where it doesn't seem to make as much difference. This suffices for a known set of data but doesn't feel very satisfactory in terms of future-proofing. I would appreciate it if anyone else has a better way of doing things.
Why not using the destructor "__destruct()" to clean up?
I take your point and had considered it but (and I haven't actually tried this) I wasn't sure if I called __destruct deliberately then it would be called again when the object was actually destroyed.
The main reason I initially made my own method, though, was so that I could put some code in __destruct to flag that the object had actually been destroyed - some objects were destroying themselves fine, others weren't and __destruct seemed the best way to debug when an object actually disappeared.
The destructor isn't called until the object is being destroyed. Because of the existing references, the object isn't being destroyed until the end of the request and therefore putting this code in the destructor doesn't work.
Wow, someone else actually trying to memory manage parent-child relationships in PHP!
So, I have been grappling with this problem while working on Propel. I actually found a way to create non-refcounted references in PHP5... if you $a = &$b; where $b is an object, $a points to it, but doesn't bump the refcount. Which is half of the solution...
The other problem I've found though is that you can't create a non-refcounted reference to $this, so in your function like $child->setParent($this) it doesn't work. It does work if you $child->setParent($parent) though, and then you don't have to explicitly call destroy() methods.
I am trying to find a way around the $this problem as we speak....
-Alan
In reply to alan, apparent you can use $this->this to get a non ref-counted reference to a class. I have this recursive reference problem, and thats one way around it, althou there is a severe lack of documentation about $this->this
http://www.zend.com/zend/week/week266.php
Only thing is i have no idea what version of php5 these guys are using, 5.1.2 that i'm using seems to be missing this functionality.
Now the hard bit... Click on 'Script' and enter through the menus:
Send: AT&FO&D2&EO [both capital "o", not zeros] Send CR: Send: ATV1W1S95=47 Send CR: Send: AT&K3 Send CR: Send: AT+CGDCONT=1,"IP","orangeinternet" Send CR: Send: ATDT*99# Send CR: End:
Click on 'OK'.
Now to try and connect the phone to the Clie. Go to 'Modem' option in the Nokia 6600's menu (probably inside the 'Connect' folder if you haven't moved it). Click on the 'Modem' icon and select 'Connect via infrared'. The phone should start looking for something to connect to. Now go to the network setting you've just made in the Clie, point the infra red port at the phone's IR port and click 'Connect'. Then hope for the best....
This obviously isn't as good as bluetooth would be because a) you have to point the devices at each other and b) you have to navigate through a few menus just to enable the modem on the 6600, but it's the best we seem to have for a while.
Hi, dude. Have you already connected trought a nokia 6585i ir connection using a clie peg nx80v?
However, I'm somewhat confused as the closing date in the right hand side column is set at July 14th 2004, yet the application form has July 14th 2005. Does anyone have any ideas what's going on?
There are rumours about an upgrade to the 6600's firmware which may improve things, but it doesn't seem particularly easy to get hold of at the moment: either send your phone away for god knows how many weeks, or try and grab a dodgy copy and do it yourself invalidating the warranty. I think i'll wait until there's positive news on it actually fixing the problem first.
The stage I've now gotten to is:
A great source for the Palm dial-up script and settings for connecting to Orange can be found here:
Orange/Palm GPRS script
A Palm OS Nokia 6600 phone driver can be downloaded here: http://www.clieuk.co.uk/upload/Nokia6600.prc
There's an interesting thread on the matter here: Clie/Nokia 6600 GPRS internet discussion.
If you haven't been to Bethnal Green: it's a marvellous place. Where else could you buy something like this?:
dear karl
yes i agree bethnal green is a colourfull & historical place evan to this day even though i dont live there anymore it still hold true in me the eastender evan after 33 years i still remember bethnal green rd brick lane victoria park fishing in canals ? pie&mash baigals in brick lne and every where i went as a boy & even after revisting relatives later who still live there.best wishes stephen