Commit b94393

2026-03-18 03:23:32 German Gamboa: -/-
/dev/null .. sql/general notes.md
@@ 0,0 1,16 @@
+ # General Notes
+
+ ## Offload as much work from the application layer to the database.
+ thoughs here is db is going to be faster than the app layer most of the time.
+ Also its easier to deal with the "distributedness" of a system by just doing it in a in a single spot.
+
+
+ ## unnest is pretty cool for inserting multiple rows:
+ ```sql
+ INSERT INTO table_name (col1, col2, col3)
+ SELECT * FROM UNNEST(
+ ARRAY['val1', 'val2', 'val3'],
+ ARRAY['val4', 'val5', 'val6'],
+ ARRAY[1, 2, 3]
+ );
+ ```
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9