公司最近有個deployment,要run個SQL patch。係QA 同staging 都冇事,點知一去production run左30mins 都未行完,terminated & rollback. 原來係其中一個update statement 行subquery,where id = (select …) mysql 會run select on each row 🙁 DataSet 一大,慢到嘔。
1 2 3 4 5 6 7 8 9 10 11 |
CREATE TABLE alarm_backup SELECT * FROM alarm; UPDATE alarm a SET a.status = 'active' , ....... WHERE a.id = ( SELECT al.id FROM alarm_backup ab JOIN device d ON ab.device_id = d.id JOIN ...... WHERE ..... ); |
其實subquery 係唔需要⋯⋯
1 2 3 4 5 6 7 |
CREATE TABLE alarm_backup SELECT * FROM alarm; UPDATE alarm a JOIN device d ON a.device_id = d.id JOIN ...... SET a.status = 'active' , ....... WHERE ..... ; |
故事教訓我地: 1) 放假返黎之後小心點,你唔係到個時既Peer review 都要睇返。 2) 唔好咁容易信你上司,上左神枱技術係會回塘 😂
funny, you can get a free tee shirt when you make 5 pull request in Oct 1-31. This is the 5th year but I only knew it now 😛 check out the details in https://hacktoberfest.digitalocean.com/
24 hours 快閃到sydney 訓一晚. 原本打算早點出門, 行過Sydney University 參觀吓先到會場, 可惜落雨都係uber. Keynote 比較大路,冇乜特別,都係話google 投資左好多錢咁啦。GCP 起步遲過AWS, 不過我覺得kubernetes 先係王道,比起vendor lock in AWS 好. 其次我覺得AWS product啲名好麻煩好難記 😅 1st: CI/CD pipelines in the cloud 由source code repo, build & test, artifact management, deliver. 以前係svn + maven + jenkins,而家係github/gitlab + Cloud Build + Container Registey + Spinnaker. 2nd: Kubernetes & Istio: The Efficient Approach to well-managed Infrastructure 之前聽Craig Box 嘅Podcast,今次卒之見到真人,係全日嘅session入邊佢係最流暢嘅presenter. k8s / envoy / sidecar / citadel 似乎真係要落手落腳做過先知深淺。GKE serverless Add-on looks promising. 3rd: AI drives an Exceptional Customer Experience 唔算好technical. High level concept on Contact Centre AI, 但係如果有budget implement 到真係升level 到另一個層次. Google 真係好強力推動 AI. …. 我打字實在太慢,下次再續