Wednesday 24 July 2019

LEFT JOIN Begitu Lama

Ketika melakukan LEFT JOIN begitu lama, maka ada beberapa hal yang harus diperhatikan :

  1. Kolom-kolom dalam klausa WHERE pastikan ter-index
  2. Tabel-tabel yang terlibat operasi JOIN, harus dipastikan memiliki collation yang sama

Contoh : 

EXPLAIN select p.nomor from peserta p LEFT JOIN esai e ON p.nomor=e.nomor WHERE substr(p.nomor_sekunder, 7, 2) IN ('01', '02', '03') AND p.is_hadir_kd=1 AND e.nomor IS NULL ;

Jika di Extra terdapat Using join buffer (Block Nested Loop) seperti dibawah, 


silahkan baca [1]

Referensi

  1. MySQL - how to add “Using join buffer (Block Nested Loop)” to a query?, https://stackoverflow.com/questions/34375065/mysql-how-to-add-using-join-buffer-block-nested-loop-to-a-query

Monday 7 January 2019

MySQL 8.0

...

Kerap bermasala di autentifikasi [1]:


mysql> CREATE USER 'monty'@'localhost' IDENTIFIED BY 'some_pass';

mysql> GRANT ALL PRIVILEGES ON *.* TO 'monty'@'localhost'

-> WITH GRANT OPTION;

Jika gagal, pastikan user sudah dihapus dengan benar, jika sebelumnya pernah dibuat :

DROP monty@localhost ;
FLUSH PRIVILEGES :

Baru ulangi perintah create user diatas.

Mengubah password 

alter user 'username'@'localhost' identified by 'password';

Referensi

  1. What’s New in MySQL 8.0? (Generally Available), https://mysqlserverteam.com/whats-new-in-mysql-8-0-generally-available/
  2. Host 'xxx.xx.xxx.xxx' is not allowed to connect to this MySQL server, https://stackoverflow.com/questions/1559955/host-xxx-xx-xxx-xxx-is-not-allowed-to-connect-to-this-mysql-server