cantik tak?

Ini adalah paparan terminal saya.










dan ini pula langkah-langkah untuk menghasilkan paparan terminal yang cantik itu ;p
1. buka terminal dan taip command berikut
 sudo vim ~/.bash_profile
2. paste kod dibawah kedalam .bash_profile anda.
3. Selesai.

MYSQL GROUP BY very slow

I had this problem in one of my project. Currently, we have more than 1 million data per user especially for the log file table. This huge data affecting our stats reporting and become slow and take too long to load the stats.

Here is what I found during optimisation process.

We start with normal query as below. Both query do the same objective, just want to see if there is any performance impact when I use MONTH and YEAR function in WHERE clause compared to BETWEEN … AND … for the DATETIME selection.

From the result, there is no big deal with the both method.

We continue with the test.

See?. There is huge improvement when I convert link_id to 32-bit unsigned value when do GROUP BY. The test not end here, I change my link_id field type from INT to UNSIGNED INT and test to see is there any different. Below is the test result. huh? there is not much different after changing field type from INT to UNSIGNED INT ?.

so the conclusion here, converting GROUP BY to 32-bit unsigned does affect query performance.

Senaraikan cronjob yang ada dalam server

Anda boleh gunakan arahan dibawah untuk senaraikan semua cronjob yang ada dalam server. Arahan ini berguna jika anda gunakan WHM/cpanel dan ingin lihat semua cron yang "dilarikan" oleh user

php handle 3rd party cookies

Masukkan header meta berikut ke dalam page yang akan handle cookies