-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathseed.sql
More file actions
46 lines (35 loc) · 2.55 KB
/
seed.sql
File metadata and controls
46 lines (35 loc) · 2.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
-- =============================================================
-- Seed data for Section 20 — Full-Text Search
-- =============================================================
SET search_path TO adv_fts;
INSERT INTO article (title, body, author, published_at) VALUES
('Introduction to PostgreSQL',
'PostgreSQL is a powerful open source relational database. It supports ACID transactions, foreign keys, and a rich type system including JSON and arrays.',
'Ada Lovelace', '2025-10-01'),
('Indexing strategies in Postgres',
'B-tree indexes are the default in PostgreSQL. GIN indexes power full text search and array queries. Partial and covering indexes can dramatically improve query performance.',
'Alan Turing', '2025-11-12'),
('Writing faster SQL queries',
'Good SQL starts with understanding the query planner. Use EXPLAIN ANALYZE to measure, avoid SELECT *, and prefer set-based logic over loops in application code.',
'Grace Hopper', '2025-12-03'),
('A tour of JSONB in PostgreSQL',
'The JSONB type stores JSON in a binary format that is much faster to query than plain JSON. Use GIN indexes for containment queries and the ->> operator to extract text.',
'Linus Torvalds', '2026-01-14'),
('Scaling a Postgres database',
'Scaling starts with good schema design. Add read replicas before you add shards. Use connection pooling. Tune work_mem for heavy analytical workloads.',
'Margaret Hamilton', '2026-02-02'),
('Python versus Ruby for web scraping',
'Python has BeautifulSoup and Scrapy. Ruby has Nokogiri. Both are excellent choices for crawling websites and extracting structured data from HTML.',
'Dennis Ritchie', '2026-02-14'),
('Introduction to machine learning',
'Machine learning lets programs learn from data instead of being explicitly programmed. Classic models include linear regression, decision trees, and neural networks.',
'Katherine Johnson', '2026-03-05'),
('Docker for SQL developers',
'Running Postgres in Docker is a great way to get a disposable local database. Use volumes to persist data across container restarts.',
'Radia Perlman', '2026-03-18'),
('The history of the relational model',
'Edgar Codd introduced the relational model in 1970. It took nearly a decade for commercial databases to catch up. Today, relational databases still power most of the internet.',
'Barbara Liskov', '2026-03-30'),
('Observability for database-backed apps',
'Logs, metrics, and traces form the three pillars of observability. For database-backed apps, pay particular attention to slow queries and connection pool saturation.',
'Edsger Dijkstra', '2026-04-02');