在資料庫當中,為了改進查詢效率,在資料量大的時候,可以透過建立索引讓資料庫加速查詢效率。本篇文章將會探討 PostgreSQL 的 index。
雖然在大部分的情況,直接使用 CREATE INDEX 的語法已經能夠應付常見的開發場景,但是在 PostgreSQL 當中,其實還提供了許多不同的 index types 使用。
CREATE INDEX
官方文件寫得很好,不過 redux 的學習曲線其實不低,尤其是在剛入門 React 時,很容易就會陷入不知道為什麼要這麼做的窘境。設定一個 redux 的環境超級麻煩,要先幫 action, reducer, container 建立資料夾,寫一堆 action creator。
最後還要搭配 react-redux 寫 mapStateToProps,bindActionCreators 等等,只為了寫出一個 Todo App。
react-redux
mapStateToProps
bindActionCreators
先來看看一個 js 的神秘之處:
在職場上,偶爾會出現「天才工程師」,他們自視甚高,鄙視任何非出自於他們手中的程式碼,並且以「創造力」為最大準則。他們也相當聰明,但時間一長,或是程式碼越來越複雜,這些天才工程師的陋習就會越來越明顯。
在天才工程師的眼中,任何代碼都會說話,不需要花瑣碎的時間去寫微不足道的文件,這有辱他們的智商與人格。一旦被指派寫文件的任務,這些天才工程師就會抱怨,抱怨主管為什麼交付這種任務給他,這種事情應該由那些菜鳥工程師來做才對,怎麼可以浪費我寶貴的時間呢?久而久之,當程式碼凌亂到開始出現問題,其他工程師再也無法忍受時…