Archive for March, 2008

30th Mar 2008

MySQL tip: why are my joins so slow?

Never! Never join tables on fields with different types. Say, you have one table with `zip` varchar(5) and another with `zip` int(5). As a result of …left join … on a.zip=b.zip you will get perfomance loss up to 1000 times.

Posted by Posted by Alexander Alfimov under Filed under MySQL Comments No Comments »

02nd Mar 2008

PHP 4.x annoying bug related to $this keyword

Did you know PHP 4.x cannot take reference from $this? So, code below won’t work:

$reference = &$this;

It took me about 30 minutes to figure out what exactly was wrong with my code. So, I hope this post will help somebody else to avoid the problem.

What I did to fix it. Just added another property named “reference” to class and initialized it right after creating class instance. If anybody knows another way - please let me know.

Thank you.

Posted by Posted by Alexander Alfimov under Filed under PHP Comments No Comments »

Close
E-mail It