PinnedFundamentals of Database Engineering Note Contents成為後端工程師一年後,這一年寫了數不完的CRUD,用了原生SQL語法和ORM,發現自己對資料庫還是矇矇懂懂,每天都在操作資料,卻覺得資料庫這東西既熟悉又陌生,於是找了Fundamentals of Database Engineering這門課,目標是更有系統性得了解資料庫的原理,我把自己上這堂課的筆記都寫下來,裡面包含自己實際跟著課程操作資料的過程(資料內容未必跟課程一模一樣,大部分是依照課程內容再自己做一些變化),以及對於比較模糊的地方,再去找資料來看的筆記,若有錯誤,歡迎留言指教 (點選標...Jun 25, 2024·1 min read
Big O: Why learn to use Big O? What makes good code?Why learn to use Big O? Use Big O to measure how and why one data structure is better than others. Why do we use an array rather than an object in some cases? Each data structure has pros and cons. Big O is used to describe how efficiently the code r...Sep 24, 2024·1 min read
Big O: Space ComplexityThe space means additional space. This space doesn’t care how much size the input is. Memory Heap: store variables we assigned Stack: keep track of the function calls What takes memory space? Variables Data Structures Function Call Allocations ...Sep 24, 2024·2 min read
Big O: O(1), O(n), and O(n^2)跟課堂範例會略有不同,課堂範例程式碼是以JavaScript示範,以下筆記是改寫成Go的版本 What is good code? Readable Scalable: Big O can measure it Big O: How long does the algorithm take to run? When talking about Big O, it is about when the input grows bigger and bigger, how much time ...Sep 23, 2024·5 min read
Index: Key V.S. Non-Key Column前置作業: create students table with many columns and insert multiple dummy data postgres=# create table students ( id serial primary key, g int, firstname text, lastname text, middlename text, address text, bio text, dob date, id1 int, id2 int, id3 i...Aug 2, 2024·3 min read
Seq Table Scan, Index Scan, And Bitmap Index Scan前置作業: Create grades table and add an index to g column. postgres=# create table grades( id serial primary key, name text, g int, firstname text, lastname text, address text, bio text ); create index g_idx on grades(g) include (id); Check table stru...Jul 15, 2024·3 min read