1. 簡介
在本程式碼實驗室中,您將使用 AlloyDB for PostgreSQL 及其 AI 功能,建構智慧型會議主題搜尋和推薦系統。您將瞭解如何結合傳統關鍵字搜尋與進階語意向量搜尋、使用 QueryData 從自然語言生成可預測的 SQL 陳述式,以及運用智慧型運算子函式。
學習內容
- 部署 AlloyDB 叢集,並啟用 AI 功能。
- 載入會議資料集並瞭解其結構。
- 啟用 AlloyDB 資料存取權 API
- 使用 AlloyDB AI 運算子 (例如
ai.if和ai.rank) 執行語意動作。 - 實作混合型搜尋,結合語意向量 (ScaNN) 和文字 (RUM) 搜尋。
- 為 AlloyDB 啟用 QueryData
- 生成 QueryData 範本
- 搭配 AI 代理使用 QueryData
軟硬體需求
- 網路瀏覽器,例如 Chrome
- 已啟用計費功能的 Google Cloud 雲端專案
本程式碼研究室適合各種程度的開發人員,包括初學者。
預計總時長:60 到 70 分鐘。預估費用:低於 $3 美元 (本程式碼研究室建立的資源符合標準免費方案或試用資格)。
2. 設定和需求
專案設定
登入 Google Cloud 控制台。如果沒有 Gmail 或 Google Workspace 帳戶,請先建立帳戶。
請改用個人帳戶,而非公司或學校帳戶。
建立 Google Cloud 專案
- 在 Google Cloud 控制台的專案選取器頁面中,選取或建立 Google Cloud 專案。
- 確認 Cloud 專案已啟用計費功能。瞭解如何檢查專案是否已啟用計費功能。
啟動 Cloud Shell
雖然可以透過筆電遠端操作 Google Cloud,但在本程式碼研究室中,您將使用 Google Cloud Shell,這是可在雲端執行的指令列環境。
- 點選 Google Cloud 控制台頂端的「啟用 Cloud Shell」。
- 驗證:
gcloud auth list
- 確認專案:
gcloud config get project
- 視需要設定:
export PROJECT_ID=<YOUR_PROJECT_ID>
gcloud config set project $PROJECT_ID
3. 事前準備
啟用 API
執行下列指令,啟用所有必要的 API:
gcloud services enable alloydb.googleapis.com \
compute.googleapis.com \
cloudresourcemanager.googleapis.com \
servicenetworking.googleapis.com \
aiplatform.googleapis.com \
geminidataanalytics.googleapis.com
API 簡介
- AlloyDB API (
alloydb.googleapis.com) 可讓您建立、管理及擴充 AlloyDB for PostgreSQL 叢集。這項服務提供與 PostgreSQL 相容的全代管資料庫服務,專為要求嚴苛的企業交易和分析工作負載而設計。 - Compute Engine API (
compute.googleapis.com) 可讓您建立及管理虛擬機器 (VM)、永久磁碟和網路設定。這個服務提供執行工作負載所需的基礎架構即服務 (IaaS) 基礎,並為許多代管服務代管基礎架構。 - Cloud Resource Manager API (
cloudresourcemanager.googleapis.com) 可讓您以程式輔助方式管理 Google Cloud 雲端專案的中繼資料和設定。您可以在專案階層中整理資源、處理 Identity and Access Management (IAM) 政策,以及驗證權限。 - Service Networking API (
servicenetworking.googleapis.com) 可讓您自動設定虛擬私有雲 (VPC) 網路與 Google 代管服務之間的私人連線。您必須建立服務 (例如 AlloyDB) 的私人 IP 存取權,才能與其他資源安全地通訊。 - Vertex AI API (
aiplatform.googleapis.com) 可讓應用程式建構、部署及擴充機器學習模型。這個平台提供統一的介面,方便您使用所有 Google Cloud AI 服務,包括存取生成式 AI 模型 (如 Gemini) 和模型訓練。 - 資料分析 API (
geminidataanalytics.googleapis.com) 可讓應用程式在 BI 產品中使用一般 AI 功能。
4. 佈建 AlloyDB
建立 AlloyDB 叢集和主要執行個體。
建立私人 IP 範圍
AlloyDB 需要虛擬私有雲中的私人 IP 範圍。假設您使用 default 虛擬私有雲網路:
- 建立私人 IP 範圍:
gcloud compute addresses create psa-range \
--global \
--purpose=VPC_PEERING \
--prefix-length=24 \
--description="VPC private service access" \
--network=default
- 建立私人連線:
gcloud services vpc-peerings connect \
--service=servicenetworking.googleapis.com \
--ranges=psa-range \
--network=default
建立 AlloyDB 叢集
- 為
postgres使用者建立密碼:
export PGPASSWORD=`openssl rand -hex 12`
echo $PGPASSWORD
- 建立免費試用叢集 (「試用」),或標準叢集 (「標準」),如果不是第一次:
export REGION=us-central1
export ADBCLUSTER=alloydb-next26-ai-demo-01
gcloud alloydb clusters create $ADBCLUSTER \
--password=$PGPASSWORD \
--network=default \
--region=$REGION \
--subscription-type=TRIAL
- 建立主要執行個體:
gcloud alloydb instances create $ADBCLUSTER-pr \
--instance-type=PRIMARY \
--cpu-count=8 \
--region=$REGION \
--cluster=$ADBCLUSTER
5. 設定資料庫權限
啟用 Vertex AI 權限,產生嵌入內容
PROJECT_ID=$(gcloud config get-value project)
gcloud projects add-iam-policy-binding $PROJECT_ID \
--member="serviceAccount:service-$(gcloud projects describe $PROJECT_ID --format="value(projectNumber)")@gcp-sa-alloydb.iam.gserviceaccount.com" \
--role="roles/aiplatform.user"
啟用 Data Access API
您必須在 AlloyDB 叢集上啟用 Data Access API,才能使用 QueryData 脈絡建立範本,協助從自然語言建立可預測的 SQL 陳述式。
在同一個終端機分頁中執行:
PROJECT_ID=$(gcloud config get-value project)
REGION=us-central1
ADBCLUSTER=alloydb-next26-ai-demo-01
curl -X PATCH \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json" \
https://alloydb.googleapis.com/v1alpha/projects/$PROJECT_ID/locations/$REGION/clusters/$ADBCLUSTER/instances/$ADBCLUSTER-pr?updateMask=dataApiAccess \
-d '{
"dataApiAccess": "ENABLED",
}'
啟用 IAM 驗證
如要使用代理程式工具,您必須在執行個體上啟用 IAM 驗證,然後將自己新增為使用者。
在同一個終端機分頁中執行下列指令,在執行個體上啟用 IAM:
PROJECT_ID=$(gcloud config get-value project)
REGION=us-central1
ADBCLUSTER=alloydb-next26-ai-demo-01
gcloud beta alloydb instances update $ADBCLUSTER-pr \
--database-flags alloydb.iam_authentication=on \
--region=$REGION \
--cluster=$ADBCLUSTER \
--project=$PROJECT_ID \
--update-mode=FORCE_APPLY
將自己新增為 AlloyDB 使用者:
REGION=us-central1
ADBCLUSTER=alloydb-next26-ai-demo-01
gcloud alloydb users create $(gcloud config get-value account) \
--cluster=$ADBCLUSTER \
--region=$REGION \
--type=IAM_BASED \
--db-roles=alloydbsuperuser
6. 準備範例資料庫
連線至 AlloyDB Studio
- 前往 Google Cloud 控制台的「AlloyDB for Postgres」頁面。
- 按一下主要執行個體。
- 按一下左側導覽列中的「AlloyDB Studio」。
- 選取
postgres資料庫 - 透過
IAM database authentication進行驗證
建立資料庫
在查詢編輯器中執行下列 SQL:
CREATE DATABASE conference_db;
切換至 conference_db 資料庫:
- 按一下
AlloyDB studio畫面左上方的Current user按鈕 - 按一下「
Switch user/database」按鈕 - 選取新建立的
conference_db資料庫。
啟用 pgvector
確認已啟用標準 vector 擴充功能:
CREATE EXTENSION IF NOT EXISTS vector;
載入範例資料
執行下列 SQL 指令碼,建立結構定義並填入範例資料:
1. 清除先前任何衝突的表格
DROP TABLE IF EXISTS public.attendees_sessions CASCADE;
DROP TABLE IF EXISTS public.session_speaker_mapping CASCADE;
DROP TABLE IF EXISTS public.session_topic_mapping CASCADE;
DROP TABLE IF EXISTS public.session CASCADE;
DROP TABLE IF EXISTS public.attendees CASCADE;
DROP TABLE IF EXISTS public.speaker CASCADE;
DROP TABLE IF EXISTS public.session_topic CASCADE;
2. 建立資料表
CREATE TABLE public.attendees (
username character varying(100) NOT NULL PRIMARY KEY,
name character varying(100),
company character varying(150),
job_title character varying(100),
area_of_interest character varying(100),
street_address text,
city character varying(100),
state_province character varying(100),
country character varying(100),
created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP
);
CREATE TABLE public.attendees_sessions (
username character varying(100) NOT NULL REFERENCES public.attendees(username),
session_id character varying(50) NOT NULL,
registration_date timestamp without time zone DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (username, session_id)
);
CREATE TABLE public.session (
session_id character varying(50) NOT NULL PRIMARY KEY,
session_name character varying(255) NOT NULL,
full_description text,
full_description_embedding vector(768) GENERATED ALWAYS AS (embedding('text-embedding-005', full_description)) STORED,
description_tsvector tsvector GENERATED ALWAYS AS (to_tsvector('english', full_description)) STORED,
session_format character varying(50),
learning_level character varying(50),
session_url character varying(255),
for_job_role character varying(250),
session_date date,
session_start_time time without time zone,
session_end_time time without time zone,
session_location character varying(100),
capacity integer,
remaining_capacity integer,
interest_area character varying(100),
industry character varying(100)
);
COMMENT ON COLUMN public.session.session_format IS 'The format of a session. Possible values are Keynotes, Breakouts, Lightning Talks.';
CREATE TABLE public.speaker (
speaker_id integer NOT NULL PRIMARY KEY,
speaker_name character varying(100) NOT NULL,
job_title character varying(100),
company character varying(100),
type character varying(50),
profile_pic character varying(100),
speaker_url character varying(100)
);
CREATE TABLE public.session_speaker_mapping (
session_id character varying(50) NOT NULL REFERENCES public.session(session_id),
speaker_id integer NOT NULL REFERENCES public.speaker(speaker_id),
PRIMARY KEY (session_id, speaker_id)
);
CREATE TABLE public.session_topic (
topic character varying(100) NOT NULL PRIMARY KEY,
topic_desc text,
embedding vector(768) GENERATED ALWAYS AS (embedding('text-embedding-005', topic_desc)) STORED
);
CREATE TABLE public.session_topic_mapping (
session_id character varying(50) NOT NULL REFERENCES public.session(session_id),
topic character varying(100) NOT NULL REFERENCES public.session_topic(topic),
PRIMARY KEY (session_id, topic)
);
3. 在資料表中填入範例資料
3.1 填入工作階段主題
-- Insert Topics
INSERT INTO public.session_topic (topic, topic_desc) VALUES
('Databases', 'Relational and non-relational database technologies.'),
('AI & Machine Learning', 'Generative AI, LLMs, and ML infrastructure.'),
('Cloud Architecture', 'Designing scalable and resilient cloud systems.'),
('Security', 'Identity, compliance, and network security.'),
('DevOps', 'CI/CD, platform engineering, and automation.') ON CONFLICT DO NOTHING;
3.2 填入音箱
-- Insert Speakers
INSERT INTO public.speaker (speaker_id, speaker_name, job_title, company, type, profile_pic, speaker_url) VALUES
(1, 'Speaker 1', 'Director of Engineering', 'DeepMind', 'External', 'pic_1.png', 'http://speakers.com/1'),
(2, 'Speaker 2', 'Cloud Architect', 'Verily', 'External', 'pic_2.png', 'http://speakers.com/2'),
(3, 'Speaker 3', 'Product Manager', 'GlobalEnterprises', 'External', 'pic_3.png', 'http://speakers.com/3'),
(4, 'Speaker 4', 'Tech Lead', 'Google', 'Internal', 'pic_4.png', 'http://speakers.com/4'),
(5, 'Speaker 5', 'Security Engineer', 'DeepMind', 'External', 'pic_5.png', 'http://speakers.com/5'),
(6, 'Speaker 6', 'DevOps Engineer', 'DeepMind', 'External', 'pic_6.png', 'http://speakers.com/6'),
(7, 'Speaker 7', 'Product Manager', 'DataSystems', 'External', 'pic_7.png', 'http://speakers.com/7'),
(8, 'Speaker 8', 'Director of Engineering', 'Google', 'Internal', 'pic_8.png', 'http://speakers.com/8'),
(9, 'Speaker 9', 'Cloud Architect', 'Google', 'Internal', 'pic_9.png', 'http://speakers.com/9'),
(10, 'Speaker 10', 'DevOps Engineer', 'Alphabet', 'Internal', 'pic_10.png', 'http://speakers.com/10'),
(11, 'Speaker 11', 'Tech Lead', 'Alphabet', 'External', 'pic_11.png', 'http://speakers.com/11'),
(12, 'Speaker 12', 'Product Manager', 'Alphabet', 'External', 'pic_12.png', 'http://speakers.com/12'),
(13, 'Speaker 13', 'Tech Lead', 'SoftSolutions', 'Internal', 'pic_13.png', 'http://speakers.com/13'),
(14, 'Speaker 14', 'Director of Engineering', 'Verily', 'Internal', 'pic_14.png', 'http://speakers.com/14'),
(15, 'Speaker 15', 'DevOps Engineer', 'CloudNative', 'External', 'pic_15.png', 'http://speakers.com/15'),
(16, 'Speaker 16', 'Software Engineer', 'Waymo', 'External', 'pic_16.png', 'http://speakers.com/16'),
(17, 'Speaker 17', 'DevOps Engineer', 'Google', 'External', 'pic_17.png', 'http://speakers.com/17'),
(18, 'Speaker 18', 'Data Scientist', 'GlobalEnterprises', 'External', 'pic_18.png', 'http://speakers.com/18'),
(19, 'Speaker 19', 'Security Engineer', 'Waymo', 'Internal', 'pic_19.png', 'http://speakers.com/19'),
(20, 'Speaker 20', 'Tech Lead', 'SoftSolutions', 'Internal', 'pic_20.png', 'http://speakers.com/20') ON CONFLICT (speaker_id) DO NOTHING;
3.3 填入出席者
-- Insert Attendees
INSERT INTO public.attendees (username, name, company, job_title, area_of_interest, street_address, city, state_province, country) VALUES
('user_1', 'Attendee 1', 'GlobalEnterprises', 'Data Scientist', 'DevOps', '1 Main St', 'CityVille', 'StateName', 'CountryName'),
('user_2', 'Attendee 2', 'Alphabet', 'Director of Engineering', 'DevOps', '2 Main St', 'CityVille', 'StateName', 'CountryName'),
('user_3', 'Attendee 3', 'CloudNative', 'Data Scientist', 'AI & Machine Learning', '3 Main St', 'CityVille', 'StateName', 'CountryName'),
('user_4', 'Attendee 4', 'SoftSolutions', 'Product Manager', 'DevOps', '4 Main St', 'CityVille', 'StateName', 'CountryName'),
('user_5', 'Attendee 5', 'DataSystems', 'Software Engineer', 'DevOps', '5 Main St', 'CityVille', 'StateName', 'CountryName'),
('user_6', 'Attendee 6', 'Google', 'Director of Engineering', 'Security', '6 Main St', 'CityVille', 'StateName', 'CountryName'),
('user_7', 'Attendee 7', 'Waymo', 'Product Manager', 'AI & Machine Learning', '7 Main St', 'CityVille', 'StateName', 'CountryName'),
('user_8', 'Attendee 8', 'Verily', 'Product Manager', 'DevOps', '8 Main St', 'CityVille', 'StateName', 'CountryName'),
('user_9', 'Attendee 9', 'Waymo', 'Software Engineer', 'DevOps', '9 Main St', 'CityVille', 'StateName', 'CountryName'),
('user_10', 'Attendee 10', 'Waymo', 'DevOps Engineer', 'Databases', '10 Main St', 'CityVille', 'StateName', 'CountryName'),
('user_11', 'Attendee 11', 'GlobalEnterprises', 'Tech Lead', 'Cloud Architecture', '11 Main St', 'CityVille', 'StateName', 'CountryName'),
('user_12', 'Attendee 12', 'Google', 'Tech Lead', 'DevOps', '12 Main St', 'CityVille', 'StateName', 'CountryName'),
('user_13', 'Attendee 13', 'DeepMind', 'Software Engineer', 'Cloud Architecture', '13 Main St', 'CityVille', 'StateName', 'CountryName'),
('user_14', 'Attendee 14', 'DataSystems', 'Security Engineer', 'DevOps', '14 Main St', 'CityVille', 'StateName', 'CountryName'),
('user_15', 'Attendee 15', 'DeepMind', 'Security Engineer', 'Cloud Architecture', '15 Main St', 'CityVille', 'StateName', 'CountryName'),
('user_16', 'Attendee 16', 'Verily', 'Security Engineer', 'Cloud Architecture', '16 Main St', 'CityVille', 'StateName', 'CountryName'),
('user_17', 'Attendee 17', 'Google', 'Software Engineer', 'Cloud Architecture', '17 Main St', 'CityVille', 'StateName', 'CountryName'),
('user_18', 'Attendee 18', 'GlobalEnterprises', 'Security Engineer', 'DevOps', '18 Main St', 'CityVille', 'StateName', 'CountryName'),
('user_19', 'Attendee 19', 'CloudNative', 'Data Scientist', 'Databases', '19 Main St', 'CityVille', 'StateName', 'CountryName'),
('user_20', 'Attendee 20', 'DataSystems', 'Cloud Architect', 'AI & Machine Learning', '20 Main St', 'CityVille', 'StateName', 'CountryName'),
('user_21', 'Attendee 21', 'Google', 'Data Scientist', 'Databases', '21 Main St', 'CityVille', 'StateName', 'CountryName'),
('user_22', 'Attendee 22', 'TechCorp', 'Data Scientist', 'DevOps', '22 Main St', 'CityVille', 'StateName', 'CountryName'),
('user_23', 'Attendee 23', 'DeepMind', 'Product Manager', 'Databases', '23 Main St', 'CityVille', 'StateName', 'CountryName'),
('user_24', 'Attendee 24', 'Google', 'Cloud Architect', 'AI & Machine Learning', '24 Main St', 'CityVille', 'StateName', 'CountryName'),
('user_25', 'Attendee 25', 'GlobalEnterprises', 'Software Engineer', 'AI & Machine Learning', '25 Main St', 'CityVille', 'StateName', 'CountryName'),
('user_26', 'Attendee 26', 'Verily', 'Security Engineer', 'Security', '26 Main St', 'CityVille', 'StateName', 'CountryName'),
('user_27', 'Attendee 27', 'GlobalEnterprises', 'Tech Lead', 'Databases', '27 Main St', 'CityVille', 'StateName', 'CountryName'),
('user_28', 'Attendee 28', 'Google', 'Tech Lead', 'Databases', '28 Main St', 'CityVille', 'StateName', 'CountryName'),
('user_29', 'Attendee 29', 'SoftSolutions', 'Software Engineer', 'Databases', '29 Main St', 'CityVille', 'StateName', 'CountryName'),
('user_30', 'Attendee 30', 'Verily', 'DevOps Engineer', 'Databases', '30 Main St', 'CityVille', 'StateName', 'CountryName'),
('user_31', 'Attendee 31', 'DeepMind', 'Data Scientist', 'Databases', '31 Main St', 'CityVille', 'StateName', 'CountryName'),
('user_32', 'Attendee 32', 'SoftSolutions', 'Software Engineer', 'Cloud Architecture', '32 Main St', 'CityVille', 'StateName', 'CountryName'),
('user_33', 'Attendee 33', 'DeepMind', 'Tech Lead', 'Databases', '33 Main St', 'CityVille', 'StateName', 'CountryName'),
('user_34', 'Attendee 34', 'Alphabet', 'Security Engineer', 'DevOps', '34 Main St', 'CityVille', 'StateName', 'CountryName'),
('user_35', 'Attendee 35', 'TechCorp', 'DevOps Engineer', 'Cloud Architecture', '35 Main St', 'CityVille', 'StateName', 'CountryName'),
('user_36', 'Attendee 36', 'DataSystems', 'Director of Engineering', 'Security', '36 Main St', 'CityVille', 'StateName', 'CountryName'),
('user_37', 'Attendee 37', 'Google', 'Cloud Architect', 'Databases', '37 Main St', 'CityVille', 'StateName', 'CountryName'),
('user_38', 'Attendee 38', 'Google', 'Product Manager', 'Security', '38 Main St', 'CityVille', 'StateName', 'CountryName'),
('user_39', 'Attendee 39', 'SoftSolutions', 'Security Engineer', 'Cloud Architecture', '39 Main St', 'CityVille', 'StateName', 'CountryName'),
('user_40', 'Attendee 40', 'Waymo', 'Director of Engineering', 'Cloud Architecture', '40 Main St', 'CityVille', 'StateName', 'CountryName'),
('user_41', 'Attendee 41', 'SoftSolutions', 'Tech Lead', 'Security', '41 Main St', 'CityVille', 'StateName', 'CountryName'),
('user_42', 'Attendee 42', 'DeepMind', 'Cloud Architect', 'Security', '42 Main St', 'CityVille', 'StateName', 'CountryName'),
('user_43', 'Attendee 43', 'TechCorp', 'Cloud Architect', 'Databases', '43 Main St', 'CityVille', 'StateName', 'CountryName'),
('user_44', 'Attendee 44', 'Alphabet', 'Security Engineer', 'AI & Machine Learning', '44 Main St', 'CityVille', 'StateName', 'CountryName'),
('user_45', 'Attendee 45', 'CloudNative', 'Cloud Architect', 'AI & Machine Learning', '45 Main St', 'CityVille', 'StateName', 'CountryName'),
('user_46', 'Attendee 46', 'CloudNative', 'Data Scientist', 'Security', '46 Main St', 'CityVille', 'StateName', 'CountryName'),
('user_47', 'Attendee 47', 'DeepMind', 'Data Scientist', 'Security', '47 Main St', 'CityVille', 'StateName', 'CountryName'),
('user_48', 'Attendee 48', 'Verily', 'DevOps Engineer', 'AI & Machine Learning', '48 Main St', 'CityVille', 'StateName', 'CountryName'),
('user_49', 'Attendee 49', 'Verily', 'Director of Engineering', 'AI & Machine Learning', '49 Main St', 'CityVille', 'StateName', 'CountryName'),
('user_50', 'Attendee 50', 'Google', 'Director of Engineering', 'DevOps', '50 Main St', 'CityVille', 'StateName', 'CountryName') ON CONFLICT (username) DO NOTHING;
3.4 填入工作階段
-- Insert Sessions
INSERT INTO public.session (session_id, session_name, full_description, session_format, learning_level, session_url, for_job_role, session_date, session_start_time, session_end_time, session_location, capacity, remaining_capacity, interest_area, industry) VALUES
('S001', 'AlloyDB Deep Dive: Advanced Performance Tuning', 'Learn how to squeeze every drop of performance out of AlloyDB. This session covers index tuning, memory management, and advanced query optimization techniques.', 'Lightning Talks', 'Beginner', 'http://sessions.com/S001', 'Cloud Architect', '2026-04-11', '15:00:00', '15:00:00', 'Room C', 500, 192, 'Databases', 'Technology'),
('S002', 'Vector Search at Scale with ScaNN in AlloyDB', 'Discover how to use ScaNN for fast approximate nearest neighbor search in AlloyDB. Perfect for building high-scale recommendation systems.', 'Breakouts', 'Intermediate', 'http://sessions.com/S002', 'Cloud Architect', '2026-04-10', '14:00:00', '14:00:00', 'Auditorium', 100, 16, 'Databases', 'Retail'),
('S003', 'Building Gen AI Apps with Vertex AI and AlloyDB', 'A practical guide to integrating Vertex AI embeddings and LLMs with your operational data in AlloyDB to build intelligent applications.', 'Lightning Talks', 'Advanced', 'http://sessions.com/S003', 'Director of Engineering', '2026-04-11', '11:00:00', '11:00:00', 'Auditorium', 50, 28, 'Databases', 'Healthcare'),
('S004', 'Spanner: Architecting for Global Consistency', 'Learn how Spanner achieves global scale without sacrificing strong consistency. We will cover multi-region deployment patterns.', 'Keynotes', 'Intermediate', 'http://sessions.com/S004', 'Cloud Architect', '2026-04-11', '11:00:00', '11:00:00', 'Room B', 500, 441, 'Databases', 'Healthcare'),
('S005', 'BigQuery + Vertex AI: Predictive Analytics Made Easy', 'See how to combine the power of BigQuery for data warehousing with Vertex AI for machine learning to build predictive models directly on your data.', 'Breakouts', 'Advanced', 'http://sessions.com/S005', 'Product Manager', '2026-04-11', '14:00:00', '14:00:00', 'Room C', 100, 96, 'AI & Machine Learning', 'Retail'),
('S006', 'Securing Your Data: Best Practices in AlloyDB', 'Deep dive into the security features of AlloyDB, including IAM integration, encryption at rest and in transit, and audit logging.', 'Keynotes', 'Beginner', 'http://sessions.com/S006', 'Product Manager', '2026-04-09', '15:00:00', '15:00:00', 'Room C', 200, 199, 'Databases', 'Healthcare'),
('S007', 'Kubernetes for Databases: Running PostgreSQL on GKE', 'Best practices for running stateful workloads like PostgreSQL on Google Kubernetes Engine (GKE).', 'Lightning Talks', 'Intermediate', 'http://sessions.com/S007', 'Software Engineer', '2026-04-09', '16:00:00', '16:00:00', 'Room C', 100, 63, 'Databases', 'Retail'),
('S008', 'Real-time Analytics with BigQuery and Pub/Sub', 'Learn how to build real-time data pipelines using Pub/Sub and stream data directly into BigQuery for instant insights.', 'Keynotes', 'Beginner', 'http://sessions.com/S008', 'Security Engineer', '2026-04-10', '14:00:00', '14:00:00', 'Room C', 200, 65, 'Databases', 'Finance'),
('S009', 'Microservices Architecture with Spanner', 'How to design microservices that leverage Spanner''s unique capabilities for distributed transactions and scalability.', 'Keynotes', 'Beginner', 'http://sessions.com/S009', 'Software Engineer', '2026-04-11', '10:00:00', '10:00:00', 'Auditorium', 100, 25, 'Databases', 'Technology'),
('S010', 'AI-Powered Search with ScaNN and LLMs', 'Learn how to combine ScaNN vector search with Large Language Models to create powerful, context-aware search experiences.', 'Keynotes', 'Intermediate', 'http://sessions.com/S010', 'Tech Lead', '2026-04-11', '11:00:00', '11:00:00', 'Room C', 50, 27, 'AI & Machine Learning', 'Healthcare'),
('S011', 'AlloyDB Omni: Run AlloyDB Anywhere', 'Explore AlloyDB Omni, the downloadable edition of AlloyDB that lets you run the same high-performance database in your own data center or on the edge.', 'Breakouts', 'Intermediate', 'http://sessions.com/S011', 'Cloud Architect', '2026-04-09', '10:00:00', '10:00:00', 'Room B', 200, 195, 'Databases', 'Technology'),
('S012', 'Data Mesh on Google Cloud: Best Practices', 'How to implement a decentralized data mesh architecture using BigQuery, Dataplex, and other Google Cloud tools.', 'Lightning Talks', 'Intermediate', 'http://sessions.com/S012', 'Data Scientist', '2026-04-10', '16:00:00', '16:00:00', 'Room C', 100, 46, 'Cloud Architecture', 'Technology'),
('S013', 'Serverless Databases: When to use Cloud SQL vs AlloyDB', 'A comparison of Cloud SQL and AlloyDB, helping you choose the right database for your serverless and traditional applications.', 'Lightning Talks', 'Beginner', 'http://sessions.com/S013', 'DevOps Engineer', '2026-04-10', '11:00:00', '11:00:00', 'Room C', 500, 458, 'Databases', 'Manufacturing'),
('S014', 'Graph Databases on Google Cloud', 'Explore options for graph data processing on Google Cloud, including integrations with existing database services.', 'Breakouts', 'Advanced', 'http://sessions.com/S014', 'DevOps Engineer', '2026-04-11', '09:00:00', '09:00:00', 'Room C', 500, 338, 'DevOps', 'Finance'),
('S015', 'Automating DB Ops with Gemini', 'See how Gemini can help DBA and developers write better SQL, optimize queries, and manage database infrastructure.', 'Breakouts', 'Advanced', 'http://sessions.com/S015', 'Cloud Architect', '2026-04-11', '14:00:00', '14:00:00', 'Room C', 100, 53, 'AI & Machine Learning', 'Retail'),
('S016', 'High Availability and Disaster Recovery in AlloyDB', 'A deep dive into how AlloyDB ensures your data is always available, covering failover mechanisms and backup strategies.', 'Breakouts', 'Advanced', 'http://sessions.com/S016', 'Cloud Architect', '2026-04-11', '11:00:00', '11:00:00', 'Room A', 200, 52, 'Databases', 'Technology'),
('S017', 'Optimizing Costs in BigQuery', 'Practical tips for reducing your BigQuery bill without sacrificing performance, covering slot management and query optimization.', 'Lightning Talks', 'Beginner', 'http://sessions.com/S017', 'Security Engineer', '2026-04-11', '15:00:00', '15:00:00', 'Room B', 100, 65, 'Databases', 'Manufacturing'),
('S018', 'Continuous Integration for Database Schemas', 'How to apply CI/CD principles to database schema changes using tools like Liquibase or Flyway on Google Cloud.', 'Breakouts', 'Beginner', 'http://sessions.com/S018', 'Cloud Architect', '2026-04-11', '09:00:00', '09:00:00', 'Room B', 50, 30, 'Security', 'Technology'),
('S019', 'Data Governance in the Age of AI', 'Learn how to maintain data quality, privacy, and compliance when feeding enterprise data into AI models.', 'Breakouts', 'Beginner', 'http://sessions.com/S019', 'Product Manager', '2026-04-10', '10:00:00', '10:00:00', 'Room A', 100, 39, 'DevOps', 'Retail'),
('S020', 'Hybrid Search: Combining Vector and Keyword Search', 'Learn how to implement hybrid search in AlloyDB to get the best of both worlds: semantic understanding and precise keyword matching.', 'Breakouts', 'Intermediate', 'http://sessions.com/S020', 'Data Scientist', '2026-04-09', '14:00:00', '14:00:00', 'Auditorium', 500, 176, 'Databases', 'Manufacturing'),
('S021', 'Deep Dive into ScaNN for High Availability', 'Join this session to explore how ScaNN can be used for High Availability. We will cover best practices, real-world use cases, and advanced configuration options.', 'Breakouts', 'Advanced', 'http://sessions.com/S021', 'Software Engineer', '2026-04-11', '14:00:00', '14:00:00', 'Room B', 200, 18, 'AI & Machine Learning', 'Finance'),
('S022', 'Understanding Vertex AI for Modernization', 'Join this session to explore how Vertex AI can be used for Modernization. We will cover best practices, real-world use cases, and advanced configuration options.', 'Lightning Talks', 'Beginner', 'http://sessions.com/S022', 'Tech Lead', '2026-04-09', '09:00:00', '09:00:00', 'Room A', 50, 48, 'AI & Machine Learning', 'Finance'),
('S023', 'Securing Vertex AI for Modernization', 'Join this session to explore how Vertex AI can be used for Modernization. We will cover best practices, real-world use cases, and advanced configuration options.', 'Lightning Talks', 'Intermediate', 'http://sessions.com/S023', 'Tech Lead', '2026-04-10', '10:00:00', '10:00:00', 'Auditorium', 200, 96, 'AI & Machine Learning', 'Manufacturing'),
('S024', 'Mastering Kubernetes for Security', 'Join this session to explore how Kubernetes can be used for Security. We will cover best practices, real-world use cases, and advanced configuration options.', 'Lightning Talks', 'Beginner', 'http://sessions.com/S024', 'DevOps Engineer', '2026-04-09', '09:00:00', '09:00:00', 'Auditorium', 200, 160, 'Security', 'Technology'),
('S025', 'Mastering AlloyDB for Modernization', 'Join this session to explore how AlloyDB can be used for Modernization. We will cover best practices, real-world use cases, and advanced configuration options.', 'Breakouts', 'Advanced', 'http://sessions.com/S025', 'Director of Engineering', '2026-04-11', '16:00:00', '16:00:00', 'Room B', 200, 74, 'Databases', 'Healthcare'),
('S026', 'Securing Vertex AI for Automation', 'Join this session to explore how Vertex AI can be used for Automation. We will cover best practices, real-world use cases, and advanced configuration options.', 'Keynotes', 'Advanced', 'http://sessions.com/S026', 'Cloud Architect', '2026-04-11', '16:00:00', '16:00:00', 'Room A', 50, 25, 'AI & Machine Learning', 'Manufacturing'),
('S027', 'Mastering BigQuery for Analytics', 'Join this session to explore how BigQuery can be used for Analytics. We will cover best practices, real-world use cases, and advanced configuration options.', 'Breakouts', 'Intermediate', 'http://sessions.com/S027', 'Security Engineer', '2026-04-11', '10:00:00', '10:00:00', 'Room B', 200, 117, 'Databases', 'Healthcare'),
('S028', 'Deep Dive into Spanner for Integration', 'Join this session to explore how Spanner can be used for Integration. We will cover best practices, real-world use cases, and advanced configuration options.', 'Lightning Talks', 'Advanced', 'http://sessions.com/S028', 'Tech Lead', '2026-04-09', '10:00:00', '10:00:00', 'Auditorium', 50, 32, 'Databases', 'Retail'),
('S029', 'Scaling Generative AI for Automation', 'Join this session to explore how Generative AI can be used for Automation. We will cover best practices, real-world use cases, and advanced configuration options.', 'Keynotes', 'Intermediate', 'http://sessions.com/S029', 'Tech Lead', '2026-04-09', '10:00:00', '10:00:00', 'Room A', 200, 157, 'AI & Machine Learning', 'Healthcare'),
('S030', 'Deploying Generative AI for Analytics', 'Join this session to explore how Generative AI can be used for Analytics. We will cover best practices, real-world use cases, and advanced configuration options.', 'Keynotes', 'Advanced', 'http://sessions.com/S030', 'Director of Engineering', '2026-04-09', '16:00:00', '16:00:00', 'Room B', 500, 462, 'DevOps', 'Healthcare'),
('S031', 'Mastering ScaNN for High Availability', 'Join this session to explore how ScaNN can be used for High Availability. We will cover best practices, real-world use cases, and advanced configuration options.', 'Breakouts', 'Beginner', 'http://sessions.com/S031', 'Director of Engineering', '2026-04-10', '09:00:00', '09:00:00', 'Room C', 500, 140, 'AI & Machine Learning', 'Finance'),
('S032', 'Deploying Kubernetes for Integration', 'Join this session to explore how Kubernetes can be used for Integration. We will cover best practices, real-world use cases, and advanced configuration options.', 'Breakouts', 'Advanced', 'http://sessions.com/S032', 'Cloud Architect', '2026-04-11', '14:00:00', '14:00:00', 'Auditorium', 200, 22, 'Databases', 'Retail'),
('S033', 'Securing Gemini for Performance', 'Join this session to explore how Gemini can be used for Performance. We will cover best practices, real-world use cases, and advanced configuration options.', 'Keynotes', 'Intermediate', 'http://sessions.com/S033', 'Cloud Architect', '2026-04-09', '16:00:00', '16:00:00', 'Room B', 200, 84, 'AI & Machine Learning', 'Technology'),
('S034', 'Deploying Vertex AI for Scale', 'Join this session to explore how Vertex AI can be used for Scale. We will cover best practices, real-world use cases, and advanced configuration options.', 'Breakouts', 'Intermediate', 'http://sessions.com/S034', 'Director of Engineering', '2026-04-10', '10:00:00', '10:00:00', 'Room B', 500, 222, 'AI & Machine Learning', 'Finance'),
('S035', 'Deep Dive into BigQuery for Analytics', 'Join this session to explore how BigQuery can be used for Analytics. We will cover best practices, real-world use cases, and advanced configuration options.', 'Breakouts', 'Intermediate', 'http://sessions.com/S035', 'Security Engineer', '2026-04-11', '15:00:00', '15:00:00', 'Room A', 500, 408, 'Databases', 'Healthcare'),
('S036', 'Deploying Kubernetes for Security', 'Join this session to explore how Kubernetes can be used for Security. We will cover best practices, real-world use cases, and advanced configuration options.', 'Keynotes', 'Advanced', 'http://sessions.com/S036', 'Tech Lead', '2026-04-10', '09:00:00', '09:00:00', 'Room A', 200, 54, 'Security', 'Healthcare'),
('S037', 'Understanding Spanner for Integration', 'Join this session to explore how Spanner can be used for Integration. We will cover best practices, real-world use cases, and advanced configuration options.', 'Lightning Talks', 'Beginner', 'http://sessions.com/S037', 'Tech Lead', '2026-04-10', '14:00:00', '14:00:00', 'Room C', 200, 89, 'Databases', 'Technology'),
('S038', 'Deep Dive into Kubernetes for Automation', 'Join this session to explore how Kubernetes can be used for Automation. We will cover best practices, real-world use cases, and advanced configuration options.', 'Lightning Talks', 'Beginner', 'http://sessions.com/S038', 'Product Manager', '2026-04-11', '09:00:00', '09:00:00', 'Room C', 50, 47, 'AI & Machine Learning', 'Healthcare'),
('S039', 'Optimizing BigQuery for Reliability', 'Join this session to explore how BigQuery can be used for Reliability. We will cover best practices, real-world use cases, and advanced configuration options.', 'Keynotes', 'Beginner', 'http://sessions.com/S039', 'Director of Engineering', '2026-04-10', '14:00:00', '14:00:00', 'Auditorium', 200, 38, 'Databases', 'Retail'),
('S040', 'Deep Dive into Spanner for Cost Efficiency', 'Join this session to explore how Spanner can be used for Cost Efficiency. We will cover best practices, real-world use cases, and advanced configuration options.', 'Lightning Talks', 'Advanced', 'http://sessions.com/S040', 'Software Engineer', '2026-04-09', '14:00:00', '14:00:00', 'Auditorium', 50, 2, 'Databases', 'Healthcare'),
('S041', 'Exploring Gemini for Cost Efficiency', 'Join this session to explore how Gemini can be used for Cost Efficiency. We will cover best practices, real-world use cases, and advanced configuration options.', 'Keynotes', 'Intermediate', 'http://sessions.com/S041', 'Product Manager', '2026-04-10', '15:00:00', '15:00:00', 'Room A', 100, 73, 'AI & Machine Learning', 'Healthcare'),
('S042', 'Mastering ScaNN for Performance', 'Join this session to explore how ScaNN can be used for Performance. We will cover best practices, real-world use cases, and advanced configuration options.', 'Breakouts', 'Beginner', 'http://sessions.com/S042', 'Tech Lead', '2026-04-09', '11:00:00', '11:00:00', 'Auditorium', 100, 50, 'AI & Machine Learning', 'Manufacturing'),
('S043', 'Mastering ScaNN for Analytics', 'Join this session to explore how ScaNN can be used for Analytics. We will cover best practices, real-world use cases, and advanced configuration options.', 'Breakouts', 'Advanced', 'http://sessions.com/S043', 'Data Scientist', '2026-04-10', '09:00:00', '09:00:00', 'Room B', 200, 111, 'AI & Machine Learning', 'Technology'),
('S044', 'Securing Gemini for Integration', 'Join this session to explore how Gemini can be used for Integration. We will cover best practices, real-world use cases, and advanced configuration options.', 'Lightning Talks', 'Advanced', 'http://sessions.com/S044', 'Cloud Architect', '2026-04-09', '14:00:00', '14:00:00', 'Auditorium', 500, 281, 'AI & Machine Learning', 'Healthcare'),
('S045', 'Architecting Cloud SQL for Integration', 'Join this session to explore how Cloud SQL can be used for Integration. We will cover best practices, real-world use cases, and advanced configuration options.', 'Lightning Talks', 'Advanced', 'http://sessions.com/S045', 'Product Manager', '2026-04-11', '11:00:00', '11:00:00', 'Room C', 50, 6, 'AI & Machine Learning', 'Retail'),
('S046', 'Securing Kubernetes for Scale', 'Join this session to explore how Kubernetes can be used for Scale. We will cover best practices, real-world use cases, and advanced configuration options.', 'Lightning Talks', 'Beginner', 'http://sessions.com/S046', 'Security Engineer', '2026-04-11', '14:00:00', '14:00:00', 'Room B', 100, 80, 'AI & Machine Learning', 'Manufacturing'),
('S047', 'Mastering PostgreSQL for Integration', 'Join this session to explore how PostgreSQL can be used for Integration. We will cover best practices, real-world use cases, and advanced configuration options.', 'Lightning Talks', 'Advanced', 'http://sessions.com/S047', 'Tech Lead', '2026-04-10', '14:00:00', '14:00:00', 'Auditorium', 200, 134, 'Databases', 'Manufacturing'),
('S048', 'Deep Dive into Kubernetes for Cost Efficiency', 'Join this session to explore how Kubernetes can be used for Cost Efficiency. We will cover best practices, real-world use cases, and advanced configuration options.', 'Breakouts', 'Intermediate', 'http://sessions.com/S048', 'Data Scientist', '2026-04-11', '09:00:00', '09:00:00', 'Room C', 500, 102, 'AI & Machine Learning', 'Retail'),
('S049', 'Deep Dive into Cloud SQL for Scale', 'Join this session to explore how Cloud SQL can be used for Scale. We will cover best practices, real-world use cases, and advanced configuration options.', 'Breakouts', 'Beginner', 'http://sessions.com/S049', 'Security Engineer', '2026-04-09', '14:00:00', '14:00:00', 'Auditorium', 200, 127, 'AI & Machine Learning', 'Healthcare'),
('S050', 'Scaling Cloud SQL for Reliability', 'Join this session to explore how Cloud SQL can be used for Reliability. We will cover best practices, real-world use cases, and advanced configuration options.', 'Keynotes', 'Intermediate', 'http://sessions.com/S050', 'Software Engineer', '2026-04-10', '15:00:00', '15:00:00', 'Room A', 100, 40, 'Cloud Architecture', 'Finance'),
('S051', 'Building Vertex AI for Security', 'Join this session to explore how Vertex AI can be used for Security. We will cover best practices, real-world use cases, and advanced configuration options.', 'Keynotes', 'Beginner', 'http://sessions.com/S051', 'Director of Engineering', '2026-04-09', '15:00:00', '15:00:00', 'Room C', 500, 138, 'AI & Machine Learning', 'Retail'),
('S052', 'Exploring Vertex AI for Modernization', 'Join this session to explore how Vertex AI can be used for Modernization. We will cover best practices, real-world use cases, and advanced configuration options.', 'Breakouts', 'Intermediate', 'http://sessions.com/S052', 'DevOps Engineer', '2026-04-09', '09:00:00', '09:00:00', 'Room C', 200, 27, 'AI & Machine Learning', 'Finance'),
('S053', 'Optimizing Generative AI for Automation', 'Join this session to explore how Generative AI can be used for Automation. We will cover best practices, real-world use cases, and advanced configuration options.', 'Keynotes', 'Beginner', 'http://sessions.com/S053', 'Director of Engineering', '2026-04-10', '11:00:00', '11:00:00', 'Room C', 500, 65, 'Databases', 'Healthcare'),
('S054', 'Architecting PostgreSQL for Performance', 'Join this session to explore how PostgreSQL can be used for Performance. We will cover best practices, real-world use cases, and advanced configuration options.', 'Breakouts', 'Beginner', 'http://sessions.com/S054', 'Data Scientist', '2026-04-09', '11:00:00', '11:00:00', 'Auditorium', 200, 103, 'Databases', 'Healthcare'),
('S055', 'Mastering Generative AI for Automation', 'Join this session to explore how Generative AI can be used for Automation. We will cover best practices, real-world use cases, and advanced configuration options.', 'Breakouts', 'Intermediate', 'http://sessions.com/S055', 'Data Scientist', '2026-04-11', '11:00:00', '11:00:00', 'Room C', 50, 31, 'AI & Machine Learning', 'Technology'),
('S056', 'Exploring ScaNN for Reliability', 'Join this session to explore how ScaNN can be used for Reliability. We will cover best practices, real-world use cases, and advanced configuration options.', 'Breakouts', 'Intermediate', 'http://sessions.com/S056', 'Security Engineer', '2026-04-11', '15:00:00', '15:00:00', 'Room A', 500, 351, 'AI & Machine Learning', 'Healthcare'),
('S057', 'Deep Dive into BigQuery for Performance', 'Join this session to explore how BigQuery can be used for Performance. We will cover best practices, real-world use cases, and advanced configuration options.', 'Breakouts', 'Intermediate', 'http://sessions.com/S057', 'DevOps Engineer', '2026-04-11', '11:00:00', '11:00:00', 'Room B', 200, 200, 'Databases', 'Finance'),
('S058', 'Scaling Generative AI for Reliability', 'Join this session to explore how Generative AI can be used for Reliability. We will cover best practices, real-world use cases, and advanced configuration options.', 'Breakouts', 'Beginner', 'http://sessions.com/S058', 'Cloud Architect', '2026-04-10', '11:00:00', '11:00:00', 'Room C', 100, 61, 'Databases', 'Finance'),
('S059', 'Securing Vertex AI for High Availability', 'Join this session to explore how Vertex AI can be used for High Availability. We will cover best practices, real-world use cases, and advanced configuration options.', 'Keynotes', 'Beginner', 'http://sessions.com/S059', 'Data Scientist', '2026-04-11', '16:00:00', '16:00:00', 'Room B', 500, 224, 'AI & Machine Learning', 'Manufacturing'),
('S060', 'Architecting AlloyDB for Integration', 'Join this session to explore how AlloyDB can be used for Integration. We will cover best practices, real-world use cases, and advanced configuration options.', 'Breakouts', 'Beginner', 'http://sessions.com/S060', 'Tech Lead', '2026-04-09', '14:00:00', '14:00:00', 'Room A', 500, 223, 'Databases', 'Technology'),
('S061', 'Understanding Spanner for High Availability', 'Join this session to explore how Spanner can be used for High Availability. We will cover best practices, real-world use cases, and advanced configuration options.', 'Keynotes', 'Advanced', 'http://sessions.com/S061', 'Tech Lead', '2026-04-09', '16:00:00', '16:00:00', 'Room C', 100, 52, 'Databases', 'Manufacturing'),
('S062', 'Scaling Kubernetes for Cost Efficiency', 'Join this session to explore how Kubernetes can be used for Cost Efficiency. We will cover best practices, real-world use cases, and advanced configuration options.', 'Breakouts', 'Advanced', 'http://sessions.com/S062', 'Product Manager', '2026-04-10', '16:00:00', '16:00:00', 'Room B', 100, 0, 'Cloud Architecture', 'Retail'),
('S063', 'Architecting Kubernetes for High Availability', 'Join this session to explore how Kubernetes can be used for High Availability. We will cover best practices, real-world use cases, and advanced configuration options.', 'Breakouts', 'Beginner', 'http://sessions.com/S063', 'Security Engineer', '2026-04-09', '10:00:00', '10:00:00', 'Auditorium', 200, 0, 'Security', 'Finance'),
('S064', 'Mastering Gemini for Integration', 'Join this session to explore how Gemini can be used for Integration. We will cover best practices, real-world use cases, and advanced configuration options.', 'Keynotes', 'Advanced', 'http://sessions.com/S064', 'Security Engineer', '2026-04-10', '15:00:00', '15:00:00', 'Room B', 100, 8, 'AI & Machine Learning', 'Technology'),
('S065', 'Optimizing Generative AI for Security', 'Join this session to explore how Generative AI can be used for Security. We will cover best practices, real-world use cases, and advanced configuration options.', 'Breakouts', 'Beginner', 'http://sessions.com/S065', 'Tech Lead', '2026-04-09', '15:00:00', '15:00:00', 'Room C', 500, 230, 'AI & Machine Learning', 'Retail'),
('S066', 'Optimizing BigQuery for Scale', 'Join this session to explore how BigQuery can be used for Scale. We will cover best practices, real-world use cases, and advanced configuration options.', 'Keynotes', 'Intermediate', 'http://sessions.com/S066', 'Tech Lead', '2026-04-11', '10:00:00', '10:00:00', 'Room C', 500, 186, 'Databases', 'Healthcare'),
('S067', 'Scaling PostgreSQL for Automation', 'Join this session to explore how PostgreSQL can be used for Automation. We will cover best practices, real-world use cases, and advanced configuration options.', 'Keynotes', 'Beginner', 'http://sessions.com/S067', 'Product Manager', '2026-04-10', '11:00:00', '11:00:00', 'Auditorium', 100, 17, 'Databases', 'Retail'),
('S068', 'Exploring AlloyDB for Automation', 'Join this session to explore how AlloyDB can be used for Automation. We will cover best practices, real-world use cases, and advanced configuration options.', 'Lightning Talks', 'Beginner', 'http://sessions.com/S068', 'Director of Engineering', '2026-04-11', '16:00:00', '16:00:00', 'Room B', 100, 77, 'Databases', 'Retail'),
('S069', 'Securing BigQuery for Cost Efficiency', 'Join this session to explore how BigQuery can be used for Cost Efficiency. We will cover best practices, real-world use cases, and advanced configuration options.', 'Breakouts', 'Advanced', 'http://sessions.com/S069', 'Cloud Architect', '2026-04-09', '14:00:00', '14:00:00', 'Room A', 500, 437, 'Databases', 'Manufacturing'),
('S070', 'Deep Dive into Kubernetes for Integration', 'Join this session to explore how Kubernetes can be used for Integration. We will cover best practices, real-world use cases, and advanced configuration options.', 'Lightning Talks', 'Intermediate', 'http://sessions.com/S070', 'Cloud Architect', '2026-04-11', '11:00:00', '11:00:00', 'Room A', 50, 46, 'AI & Machine Learning', 'Technology'),
('S071', 'Architecting ScaNN for Cost Efficiency', 'Join this session to explore how ScaNN can be used for Cost Efficiency. We will cover best practices, real-world use cases, and advanced configuration options.', 'Lightning Talks', 'Intermediate', 'http://sessions.com/S071', 'Cloud Architect', '2026-04-11', '14:00:00', '14:00:00', 'Auditorium', 100, 97, 'AI & Machine Learning', 'Finance'),
('S072', 'Scaling ScaNN for Analytics', 'Join this session to explore how ScaNN can be used for Analytics. We will cover best practices, real-world use cases, and advanced configuration options.', 'Lightning Talks', 'Beginner', 'http://sessions.com/S072', 'Cloud Architect', '2026-04-09', '11:00:00', '11:00:00', 'Room C', 100, 96, 'AI & Machine Learning', 'Manufacturing'),
('S073', 'Securing Cloud SQL for Modernization', 'Join this session to explore how Cloud SQL can be used for Modernization. We will cover best practices, real-world use cases, and advanced configuration options.', 'Keynotes', 'Advanced', 'http://sessions.com/S073', 'Tech Lead', '2026-04-10', '16:00:00', '16:00:00', 'Room C', 200, 195, 'Security', 'Technology'),
('S074', 'Deploying ScaNN for Scale', 'Join this session to explore how ScaNN can be used for Scale. We will cover best practices, real-world use cases, and advanced configuration options.', 'Breakouts', 'Beginner', 'http://sessions.com/S074', 'Data Scientist', '2026-04-10', '10:00:00', '10:00:00', 'Room A', 500, 215, 'AI & Machine Learning', 'Technology'),
('S075', 'Architecting BigQuery for Automation', 'Join this session to explore how BigQuery can be used for Automation. We will cover best practices, real-world use cases, and advanced configuration options.', 'Breakouts', 'Advanced', 'http://sessions.com/S075', 'Product Manager', '2026-04-09', '09:00:00', '09:00:00', 'Room A', 200, 110, 'Databases', 'Healthcare'),
('S076', 'Understanding Vertex AI for Scale', 'Join this session to explore how Vertex AI can be used for Scale. We will cover best practices, real-world use cases, and advanced configuration options.', 'Breakouts', 'Advanced', 'http://sessions.com/S076', 'Software Engineer', '2026-04-11', '15:00:00', '15:00:00', 'Room B', 200, 15, 'AI & Machine Learning', 'Finance'),
('S077', 'Architecting PostgreSQL for Reliability', 'Join this session to explore how PostgreSQL can be used for Reliability. We will cover best practices, real-world use cases, and advanced configuration options.', 'Keynotes', 'Advanced', 'http://sessions.com/S077', 'Director of Engineering', '2026-04-09', '11:00:00', '11:00:00', 'Room C', 200, 133, 'Databases', 'Finance'),
('S078', 'Deploying Generative AI for Analytics', 'Join this session to explore how Generative AI can be used for Analytics. We will cover best practices, real-world use cases, and advanced configuration options.', 'Lightning Talks', 'Intermediate', 'http://sessions.com/S078', 'Product Manager', '2026-04-11', '16:00:00', '16:00:00', 'Room A', 200, 190, 'AI & Machine Learning', 'Manufacturing'),
('S079', 'Deploying ScaNN for Analytics', 'Join this session to explore how ScaNN can be used for Analytics. We will cover best practices, real-world use cases, and advanced configuration options.', 'Lightning Talks', 'Advanced', 'http://sessions.com/S079', 'Cloud Architect', '2026-04-11', '16:00:00', '16:00:00', 'Room B', 200, 95, 'AI & Machine Learning', 'Technology'),
('S080', 'Securing Spanner for Security', 'Join this session to explore how Spanner can be used for Security. We will cover best practices, real-world use cases, and advanced configuration options.', 'Lightning Talks', 'Intermediate', 'http://sessions.com/S080', 'Tech Lead', '2026-04-11', '14:00:00', '14:00:00', 'Room A', 500, 310, 'Databases', 'Healthcare'),
('S081', 'Optimizing Cloud SQL for Performance', 'Join this session to explore how Cloud SQL can be used for Performance. We will cover best practices, real-world use cases, and advanced configuration options.', 'Keynotes', 'Beginner', 'http://sessions.com/S081', 'Security Engineer', '2026-04-11', '11:00:00', '11:00:00', 'Room B', 100, 76, 'Databases', 'Finance'),
('S082', 'Exploring Spanner for Cost Efficiency', 'Join this session to explore how Spanner can be used for Cost Efficiency. We will cover best practices, real-world use cases, and advanced configuration options.', 'Keynotes', 'Advanced', 'http://sessions.com/S082', 'Tech Lead', '2026-04-11', '15:00:00', '15:00:00', 'Room C', 50, 1, 'Databases', 'Manufacturing'),
('S083', 'Understanding Kubernetes for Performance', 'Join this session to explore how Kubernetes can be used for Performance. We will cover best practices, real-world use cases, and advanced configuration options.', 'Keynotes', 'Beginner', 'http://sessions.com/S083', 'Product Manager', '2026-04-11', '14:00:00', '14:00:00', 'Auditorium', 100, 49, 'Security', 'Retail'),
('S084', 'Exploring Cloud SQL for Cost Efficiency', 'Join this session to explore how Cloud SQL can be used for Cost Efficiency. We will cover best practices, real-world use cases, and advanced configuration options.', 'Breakouts', 'Intermediate', 'http://sessions.com/S084', 'Tech Lead', '2026-04-09', '16:00:00', '16:00:00', 'Room C', 500, 91, 'Cloud Architecture', 'Healthcare'),
('S085', 'Scaling Kubernetes for Automation', 'Join this session to explore how Kubernetes can be used for Automation. We will cover best practices, real-world use cases, and advanced configuration options.', 'Lightning Talks', 'Intermediate', 'http://sessions.com/S085', 'Director of Engineering', '2026-04-10', '10:00:00', '10:00:00', 'Room B', 500, 204, 'Databases', 'Finance'),
('S086', 'Deep Dive into BigQuery for Cost Efficiency', 'Join this session to explore how BigQuery can be used for Cost Efficiency. We will cover best practices, real-world use cases, and advanced configuration options.', 'Lightning Talks', 'Beginner', 'http://sessions.com/S086', 'Product Manager', '2026-04-09', '16:00:00', '16:00:00', 'Room B', 100, 89, 'Databases', 'Finance'),
('S087', 'Deep Dive into Vertex AI for Automation', 'Join this session to explore how Vertex AI can be used for Automation. We will cover best practices, real-world use cases, and advanced configuration options.', 'Breakouts', 'Beginner', 'http://sessions.com/S087', 'Data Scientist', '2026-04-10', '14:00:00', '14:00:00', 'Auditorium', 100, 74, 'AI & Machine Learning', 'Retail'),
('S088', 'Mastering AlloyDB for Modernization', 'Join this session to explore how AlloyDB can be used for Modernization. We will cover best practices, real-world use cases, and advanced configuration options.', 'Breakouts', 'Beginner', 'http://sessions.com/S088', 'Security Engineer', '2026-04-09', '16:00:00', '16:00:00', 'Room C', 100, 39, 'Databases', 'Healthcare'),
('S089', 'Exploring AlloyDB for High Availability', 'Join this session to explore how AlloyDB can be used for High Availability. We will cover best practices, real-world use cases, and advanced configuration options.', 'Breakouts', 'Advanced', 'http://sessions.com/S089', 'Data Scientist', '2026-04-10', '15:00:00', '15:00:00', 'Room A', 100, 94, 'Databases', 'Healthcare'),
('S090', 'Exploring Vertex AI for Security', 'Join this session to explore how Vertex AI can be used for Security. We will cover best practices, real-world use cases, and advanced configuration options.', 'Breakouts', 'Intermediate', 'http://sessions.com/S090', 'Security Engineer', '2026-04-11', '10:00:00', '10:00:00', 'Room B', 50, 27, 'AI & Machine Learning', 'Retail'),
('S091', 'Mastering ScaNN for Cost Efficiency', 'Join this session to explore how ScaNN can be used for Cost Efficiency. We will cover best practices, real-world use cases, and advanced configuration options.', 'Keynotes', 'Advanced', 'http://sessions.com/S091', 'DevOps Engineer', '2026-04-09', '14:00:00', '14:00:00', 'Auditorium', 100, 21, 'AI & Machine Learning', 'Technology'),
('S092', 'Mastering BigQuery for Scale', 'Join this session to explore how BigQuery can be used for Scale. We will cover best practices, real-world use cases, and advanced configuration options.', 'Breakouts', 'Advanced', 'http://sessions.com/S092', 'Cloud Architect', '2026-04-09', '16:00:00', '16:00:00', 'Room C', 200, 67, 'Databases', 'Manufacturing'),
('S093', 'Exploring AlloyDB for Performance', 'Join this session to explore how AlloyDB can be used for Performance. We will cover best practices, real-world use cases, and advanced configuration options.', 'Lightning Talks', 'Beginner', 'http://sessions.com/S093', 'Security Engineer', '2026-04-09', '10:00:00', '10:00:00', 'Room B', 200, 171, 'Databases', 'Finance'),
('S094', 'Deploying Cloud SQL for Modernization', 'Join this session to explore how Cloud SQL can be used for Modernization. We will cover best practices, real-world use cases, and advanced configuration options.', 'Lightning Talks', 'Advanced', 'http://sessions.com/S094', 'Product Manager', '2026-04-09', '14:00:00', '14:00:00', 'Room B', 100, 71, 'DevOps', 'Healthcare'),
('S095', 'Building Spanner for Analytics', 'Join this session to explore how Spanner can be used for Analytics. We will cover best practices, real-world use cases, and advanced configuration options.', 'Lightning Talks', 'Beginner', 'http://sessions.com/S095', 'Product Manager', '2026-04-10', '15:00:00', '15:00:00', 'Room B', 500, 334, 'Databases', 'Manufacturing'),
('S096', 'Deep Dive into Vertex AI for Analytics', 'Join this session to explore how Vertex AI can be used for Analytics. We will cover best practices, real-world use cases, and advanced configuration options.', 'Keynotes', 'Intermediate', 'http://sessions.com/S096', 'DevOps Engineer', '2026-04-11', '14:00:00', '14:00:00', 'Room C', 100, 27, 'AI & Machine Learning', 'Healthcare'),
('S097', 'Deploying PostgreSQL for Analytics', 'Join this session to explore how PostgreSQL can be used for Analytics. We will cover best practices, real-world use cases, and advanced configuration options.', 'Breakouts', 'Beginner', 'http://sessions.com/S097', 'Cloud Architect', '2026-04-09', '11:00:00', '11:00:00', 'Room C', 50, 36, 'Databases', 'Healthcare'),
('S098', 'Architecting Kubernetes for Reliability', 'Join this session to explore how Kubernetes can be used for Reliability. We will cover best practices, real-world use cases, and advanced configuration options.', 'Lightning Talks', 'Beginner', 'http://sessions.com/S098', 'Cloud Architect', '2026-04-10', '11:00:00', '11:00:00', 'Room A', 50, 29, 'AI & Machine Learning', 'Finance'),
('S099', 'Scaling Cloud SQL for Analytics', 'Join this session to explore how Cloud SQL can be used for Analytics. We will cover best practices, real-world use cases, and advanced configuration options.', 'Keynotes', 'Beginner', 'http://sessions.com/S099', 'DevOps Engineer', '2026-04-09', '09:00:00', '09:00:00', 'Auditorium', 50, 21, 'Security', 'Finance'),
('S100', 'Deploying PostgreSQL for Analytics', 'Join this session to explore how PostgreSQL can be used for Analytics. We will cover best practices, real-world use cases, and advanced configuration options.', 'Keynotes', 'Advanced', 'http://sessions.com/S100', 'DevOps Engineer', '2026-04-11', '09:00:00', '09:00:00', 'Room B', 500, 141, 'Databases', 'Technology') ON CONFLICT (session_id) DO NOTHING;
3.5 為場次指派講者
-- Insert Session-Speaker Mappings
INSERT INTO public.session_speaker_mapping (session_id, speaker_id) VALUES
('S001', 6),
('S001', 19),
('S002', 6),
('S002', 11),
('S003', 14),
('S003', 10),
('S004', 5),
('S004', 8),
('S005', 12),
('S005', 9),
('S006', 14),
('S007', 14),
('S007', 3),
('S008', 2),
('S008', 4),
('S009', 9),
('S009', 13),
('S010', 2),
('S010', 3),
('S011', 12),
('S012', 13),
('S013', 11),
('S014', 8),
('S015', 16),
('S016', 4),
('S016', 18),
('S017', 12),
('S018', 10),
('S019', 15),
('S020', 20),
('S020', 7),
('S021', 2),
('S021', 11),
('S022', 15),
('S022', 7),
('S023', 4),
('S023', 19),
('S024', 11),
('S025', 11),
('S025', 10),
('S026', 11),
('S027', 20),
('S028', 20),
('S028', 3),
('S029', 11),
('S029', 20),
('S030', 19),
('S030', 6),
('S031', 20),
('S031', 14),
('S032', 3),
('S033', 4),
('S033', 8),
('S034', 14),
('S035', 12),
('S035', 4),
('S036', 18),
('S037', 6),
('S038', 9),
('S038', 7),
('S039', 7),
('S040', 17),
('S041', 17),
('S042', 16),
('S042', 2),
('S043', 10),
('S043', 13),
('S044', 7),
('S045', 10),
('S046', 1),
('S046', 20),
('S047', 17),
('S048', 9),
('S048', 6),
('S049', 4),
('S049', 3),
('S050', 8),
('S050', 16),
('S051', 18),
('S051', 10),
('S052', 4),
('S053', 5),
('S053', 13),
('S054', 17),
('S055', 1),
('S056', 1),
('S056', 15),
('S057', 7),
('S058', 15),
('S059', 15),
('S059', 8),
('S060', 20),
('S060', 10),
('S061', 16),
('S062', 18),
('S062', 11),
('S063', 10),
('S064', 6),
('S065', 10),
('S066', 8),
('S066', 9),
('S067', 16),
('S067', 14),
('S068', 13),
('S068', 11),
('S069', 16),
('S070', 8),
('S071', 3),
('S072', 10),
('S072', 1),
('S073', 10),
('S073', 8),
('S074', 20),
('S074', 14),
('S075', 5),
('S076', 1),
('S076', 11),
('S077', 3),
('S078', 20),
('S078', 12),
('S079', 17),
('S079', 9),
('S080', 10),
('S081', 2),
('S082', 15),
('S082', 11),
('S083', 7),
('S083', 1),
('S084', 8),
('S085', 8),
('S085', 18),
('S086', 5),
('S087', 5),
('S088', 19),
('S088', 18),
('S089', 18),
('S090', 8),
('S091', 4),
('S092', 14),
('S093', 20),
('S093', 17),
('S094', 16),
('S094', 9),
('S095', 11),
('S095', 4),
('S096', 14),
('S096', 11),
('S097', 13),
('S097', 19),
('S098', 3),
('S099', 11),
('S099', 18),
('S100', 18),
('S100', 13) ON CONFLICT DO NOTHING;
3.6 將主題附加至課程
-- Insert Session-Topic Mappings
INSERT INTO public.session_topic_mapping (session_id, topic) VALUES
('S001', 'Security'),
('S002', 'AI & Machine Learning'),
('S003', 'Cloud Architecture'),
('S003', 'AI & Machine Learning'),
('S004', 'Databases'),
('S004', 'DevOps'),
('S005', 'DevOps'),
('S005', 'Cloud Architecture'),
('S006', 'Security'),
('S006', 'AI & Machine Learning'),
('S007', 'Cloud Architecture'),
('S007', 'Databases'),
('S008', 'AI & Machine Learning'),
('S008', 'Databases'),
('S009', 'Security'),
('S009', 'DevOps'),
('S010', 'AI & Machine Learning'),
('S010', 'Cloud Architecture'),
('S011', 'Security'),
('S012', 'Databases'),
('S013', 'Cloud Architecture'),
('S014', 'Databases'),
('S015', 'DevOps'),
('S015', 'Security'),
('S016', 'AI & Machine Learning'),
('S016', 'Databases'),
('S017', 'Cloud Architecture'),
('S018', 'AI & Machine Learning'),
('S019', 'AI & Machine Learning'),
('S020', 'Security'),
('S021', 'Security'),
('S021', 'Databases'),
('S022', 'Security'),
('S022', 'Databases'),
('S023', 'DevOps'),
('S023', 'AI & Machine Learning'),
('S024', 'AI & Machine Learning'),
('S025', 'Databases'),
('S026', 'DevOps'),
('S027', 'DevOps'),
('S027', 'Cloud Architecture'),
('S028', 'DevOps'),
('S029', 'Databases'),
('S029', 'Security'),
('S030', 'DevOps'),
('S030', 'Security'),
('S031', 'Databases'),
('S032', 'Databases'),
('S033', 'Databases'),
('S034', 'AI & Machine Learning'),
('S035', 'Security'),
('S035', 'AI & Machine Learning'),
('S036', 'AI & Machine Learning'),
('S036', 'Databases'),
('S037', 'DevOps'),
('S037', 'Databases'),
('S038', 'Cloud Architecture'),
('S038', 'Security'),
('S039', 'Security'),
('S040', 'Security'),
('S040', 'AI & Machine Learning'),
('S041', 'AI & Machine Learning'),
('S042', 'Databases'),
('S043', 'AI & Machine Learning'),
('S043', 'Databases'),
('S044', 'Databases'),
('S044', 'DevOps'),
('S045', 'DevOps'),
('S045', 'Cloud Architecture'),
('S046', 'Cloud Architecture'),
('S046', 'Security'),
('S047', 'Cloud Architecture'),
('S047', 'Security'),
('S048', 'Databases'),
('S049', 'AI & Machine Learning'),
('S049', 'Databases'),
('S050', 'Cloud Architecture'),
('S050', 'AI & Machine Learning'),
('S051', 'DevOps'),
('S051', 'Databases'),
('S052', 'Databases'),
('S053', 'DevOps'),
('S053', 'Databases'),
('S054', 'Security'),
('S054', 'DevOps'),
('S055', 'AI & Machine Learning'),
('S056', 'Security'),
('S056', 'DevOps'),
('S057', 'AI & Machine Learning'),
('S058', 'Security'),
('S058', 'AI & Machine Learning'),
('S059', 'Security'),
('S060', 'AI & Machine Learning'),
('S060', 'DevOps'),
('S061', 'Security'),
('S061', 'AI & Machine Learning'),
('S062', 'DevOps'),
('S063', 'Security'),
('S063', 'DevOps'),
('S064', 'Databases'),
('S064', 'AI & Machine Learning'),
('S065', 'DevOps'),
('S066', 'AI & Machine Learning'),
('S066', 'Cloud Architecture'),
('S067', 'AI & Machine Learning'),
('S068', 'Security'),
('S069', 'Cloud Architecture'),
('S069', 'DevOps'),
('S070', 'AI & Machine Learning'),
('S071', 'AI & Machine Learning'),
('S071', 'DevOps'),
('S072', 'DevOps'),
('S072', 'Security'),
('S073', 'Security'),
('S074', 'AI & Machine Learning'),
('S074', 'Databases'),
('S075', 'AI & Machine Learning'),
('S076', 'DevOps'),
('S077', 'DevOps'),
('S077', 'AI & Machine Learning'),
('S078', 'Databases'),
('S079', 'Databases'),
('S080', 'AI & Machine Learning'),
('S080', 'Databases'),
('S081', 'Databases'),
('S082', 'Databases'),
('S083', 'Security'),
('S084', 'Security'),
('S084', 'AI & Machine Learning'),
('S085', 'AI & Machine Learning'),
('S085', 'Databases'),
('S086', 'DevOps'),
('S087', 'Databases'),
('S088', 'Security'),
('S088', 'Databases'),
('S089', 'Databases'),
('S090', 'DevOps'),
('S091', 'Databases'),
('S092', 'Databases'),
('S093', 'Security'),
('S093', 'AI & Machine Learning'),
('S094', 'Cloud Architecture'),
('S095', 'Cloud Architecture'),
('S095', 'AI & Machine Learning'),
('S096', 'AI & Machine Learning'),
('S097', 'Security'),
('S097', 'AI & Machine Learning'),
('S098', 'Databases'),
('S098', 'Security'),
('S099', 'Cloud Architecture'),
('S100', 'DevOps'),
('S100', 'Cloud Architecture') ON CONFLICT DO NOTHING;;
3.7 將與會者指派至各場次
-- Insert Attendee-Session Mappings
INSERT INTO public.attendees_sessions (username, session_id) VALUES
('user_1', 'S100'),
('user_1', 'S008'),
('user_1', 'S060'),
('user_1', 'S090'),
('user_1', 'S057'),
('user_2', 'S086'),
('user_2', 'S033'),
('user_2', 'S006'),
('user_2', 'S043'),
('user_2', 'S050'),
('user_3', 'S066'),
('user_3', 'S099'),
('user_4', 'S004'),
('user_4', 'S043'),
('user_4', 'S092'),
('user_4', 'S033'),
('user_4', 'S074'),
('user_5', 'S014'),
('user_5', 'S088'),
('user_5', 'S093'),
('user_6', 'S075'),
('user_6', 'S033'),
('user_7', 'S014'),
('user_7', 'S021'),
('user_7', 'S047'),
('user_8', 'S051'),
('user_8', 'S081'),
('user_9', 'S048'),
('user_9', 'S100'),
('user_10', 'S037'),
('user_10', 'S059'),
('user_10', 'S083'),
('user_11', 'S007'),
('user_11', 'S099'),
('user_11', 'S054'),
('user_12', 'S006'),
('user_12', 'S046'),
('user_12', 'S077'),
('user_12', 'S032'),
('user_13', 'S020'),
('user_13', 'S029'),
('user_13', 'S054'),
('user_14', 'S052'),
('user_14', 'S070'),
('user_14', 'S028'),
('user_15', 'S054'),
('user_15', 'S050'),
('user_15', 'S025'),
('user_15', 'S066'),
('user_15', 'S081'),
('user_16', 'S099'),
('user_16', 'S073'),
('user_16', 'S027'),
('user_16', 'S058'),
('user_17', 'S092'),
('user_17', 'S089'),
('user_17', 'S076'),
('user_17', 'S062'),
('user_18', 'S083'),
('user_18', 'S094'),
('user_18', 'S097'),
('user_18', 'S031'),
('user_18', 'S040'),
('user_19', 'S078'),
('user_19', 'S072'),
('user_19', 'S049'),
('user_19', 'S017'),
('user_19', 'S084'),
('user_20', 'S023'),
('user_20', 'S003'),
('user_20', 'S016'),
('user_20', 'S068'),
('user_21', 'S071'),
('user_21', 'S058'),
('user_21', 'S043'),
('user_21', 'S079'),
('user_21', 'S067'),
('user_22', 'S076'),
('user_22', 'S038'),
('user_22', 'S049'),
('user_22', 'S033'),
('user_22', 'S070'),
('user_23', 'S032'),
('user_23', 'S099'),
('user_24', 'S022'),
('user_24', 'S065'),
('user_24', 'S060'),
('user_24', 'S084'),
('user_25', 'S077'),
('user_25', 'S080'),
('user_25', 'S097'),
('user_25', 'S010'),
('user_26', 'S063'),
('user_26', 'S052'),
('user_26', 'S086'),
('user_27', 'S054'),
('user_27', 'S094'),
('user_27', 'S018'),
('user_27', 'S061'),
('user_27', 'S052'),
('user_28', 'S064'),
('user_28', 'S070'),
('user_28', 'S050'),
('user_29', 'S009'),
('user_29', 'S012'),
('user_30', 'S058'),
('user_30', 'S056'),
('user_30', 'S072'),
('user_30', 'S093'),
('user_30', 'S045'),
('user_31', 'S001'),
('user_31', 'S094'),
('user_31', 'S065'),
('user_31', 'S031'),
('user_32', 'S048'),
('user_32', 'S011'),
('user_32', 'S065'),
('user_33', 'S021'),
('user_33', 'S081'),
('user_33', 'S063'),
('user_34', 'S068'),
('user_34', 'S026'),
('user_35', 'S044'),
('user_35', 'S054'),
('user_36', 'S023'),
('user_36', 'S051'),
('user_36', 'S100'),
('user_37', 'S047'),
('user_37', 'S053'),
('user_37', 'S057'),
('user_37', 'S048'),
('user_37', 'S080'),
('user_38', 'S003'),
('user_38', 'S038'),
('user_38', 'S046'),
('user_38', 'S005'),
('user_38', 'S076'),
('user_39', 'S046'),
('user_39', 'S020'),
('user_39', 'S043'),
('user_39', 'S002'),
('user_39', 'S100'),
('user_40', 'S019'),
('user_40', 'S098'),
('user_40', 'S053'),
('user_40', 'S007'),
('user_41', 'S100'),
('user_41', 'S032'),
('user_41', 'S048'),
('user_41', 'S064'),
('user_42', 'S086'),
('user_42', 'S030'),
('user_42', 'S049'),
('user_43', 'S033'),
('user_43', 'S008'),
('user_43', 'S049'),
('user_43', 'S093'),
('user_44', 'S078'),
('user_44', 'S071'),
('user_44', 'S067'),
('user_44', 'S012'),
('user_45', 'S043'),
('user_45', 'S056'),
('user_45', 'S079'),
('user_45', 'S062'),
('user_45', 'S039'),
('user_46', 'S054'),
('user_46', 'S031'),
('user_46', 'S018'),
('user_47', 'S035'),
('user_47', 'S100'),
('user_47', 'S083'),
('user_47', 'S080'),
('user_47', 'S037'),
('user_48', 'S097'),
('user_48', 'S026'),
('user_48', 'S065'),
('user_48', 'S030'),
('user_48', 'S074'),
('user_49', 'S022'),
('user_49', 'S089'),
('user_49', 'S038'),
('user_49', 'S047'),
('user_49', 'S073'),
('user_50', 'S074'),
('user_50', 'S033'),
('user_50', 'S069'),
('user_50', 'S036') ON CONFLICT DO NOTHING;
輸出內容應該會指出執行成功。確認資料表已填入資料。舉例來說,請確認工作階段資料表中有 100 個工作階段:
SELECT count(*) from public.session;
7. 啟用 AI 查詢引擎
使用 AI 函式前,請務必先在資料庫中啟用 AI 查詢引擎。
在 AlloyDB Studio 中執行下列 SQL (conference_db 內容):
CREATE EXTENSION IF NOT EXISTS google_ml_integration CASCADE;
ALTER DATABASE conference_db SET google_ml_integration.enable_ai_query_engine = 'on';
確認擴充功能已啟用:
SELECT extversion FROM pg_extension WHERE extname = 'google_ml_integration';
預期輸出內容應顯示 1.5.9 或更高。
8. 使用 AI 函式 (運算子)
現在,我們來搭配 ai.if 和 ai.rank 函式,使用 AI 驅動的語意篩選和評分功能。
使用 ai.if 進行語意篩選
如果沒有完全相符的關鍵字,標準文字比對可能會遺漏工作階段。讓我們使用 ai.if 尋找有關「生成式 AI」的課程。
在 AlloyDB Studio 中執行下列 SQL:
SELECT session_name, full_description
FROM public.session
WHERE
ai.if(
prompt => 'Is this session description about Generative AI, LLMs or AI agents? ' || full_description
);
即使使用不同術語,結果中也會顯示相關工作階段。
使用 ai.rank 進行語意評分
讓我們根據課程的入門難易度為課程評分。我們可以使用 ai.rank 進行語意評分。
執行下列 SQL:
SELECT session_name, full_description,
ai.rank(
prompt => 'On a scale of 0 to 1, how suitable is this session for a beginner? 1 being very suitable, 0 being advanced. Session: ' || full_description
) as beginner_friendly_score
FROM public.session
ORDER BY beginner_friendly_score DESC;
這項功能可根據會議參與者的個人資料,提供個人化建議。
9. 實作混合搜尋
混合型搜尋結合了關鍵字搜尋 (詞彙) 的精確度,以及向量搜尋 (語意) 的脈絡解讀能力。我們會為兩者建立索引,並使用倒數排名融合 (RRF) 合併結果。
啟用掃描功能
確認已啟用 scann 和 rum 擴充功能:
CREATE EXTENSION IF NOT EXISTS alloydb_scann;
CREATE EXTENSION IF NOT EXISTS rum;
建立索引
由於我們的結構定義會使用嵌入的產生資料欄 (full_description_embedding),因此系統會在插入時自動計算。我們只需要建立適當的索引,就能快速擷取資料。
建立 RUM 索引 (FTS 索引),用於全文關鍵字搜尋;建立 ScaNN 索引,用於快速向量相似度搜尋。
在 AlloyDB Studio 中執行下列 SQL:
-- Create RUM index for text search on session descriptions
CREATE INDEX session_text_idx ON public.session USING RUM (description_tsvector rum_tsvector_ops);
-- Create ScaNN index for vector search on session embeddings
CREATE INDEX session_vector_idx ON public.session
USING scann (full_description_embedding cosine)
WITH (num_leaves=10);
使用 RRF 執行混合型搜尋
現在我們要尋找 fast similarity search 的場次,但重點是 AlloyDB 的 ScaNN。
我們會使用語意搜尋和關鍵字搜尋,並以 RRF 合併結果。
執行下列 SQL:
-- Enable preview features for the AI Query Engine if not already set
SET google_ml_integration.enable_preview_ai_functions = true;
SELECT s.session_id, s.session_name, s.full_description
FROM public.session s
JOIN ai.hybrid_search(
search_inputs => ARRAY[
'{
"data_type": "vector",
"table_name": "session",
"key_column": "session_id",
"vec_column": "full_description_embedding",
"distance_operator": "public.<=>",
"limit": 5,
"query_vector": "ai.embedding(''text-embedding-005'', ''fast similarity search'')::vector"
}'::JSONB,
'{
"data_type": "text",
"table_name": "session",
"key_column": "session_id",
"text_column": "description_tsvector",
"limit": 5,
"ranking_function": "<=>",
"query_text_input": "ScaNN"
}'::JSONB
]
) AS search_results
on s.session_id = search_results.id;
您應該會看到相關的會話相似度搜尋結果,其中大部分會顯示與 ScaNN 相關的會話。
10. 在 AlloyDB Studio 中使用 QueryData
AlloyDB AI 可讓您使用 QueryData,從自然語言輸入內容生成準確且可預測的 SQL 陳述式。在本節中,您將瞭解如何建立 QueryData 內容 (範本),並直接在 AlloyDB Studio 中測試。
建立 QueryData 脈絡資料
QueryData Context 是 JSON 檔案,內含查詢範本和層面,可為 AI 模型提供必要資料和指示,以便使用正確的 SQL 查詢或 SQL 查詢部分。
讓我們看看為會議結構定義設計的 JSON 內容範例。請注意,我們會確保資料表名稱符合結構定義 (例如 public.session)。
以下是我們要使用的 JSON 內容 - 請將其儲存在筆電/電腦的本機 .json 檔案中:
{
"templates": [
{
"nlQuery": "Advanced sessions that are almost full",
"sql": "SELECT session_name, remaining_capacity, session_date, session_start_time FROM session WHERE learning_level = 'Advanced' AND remaining_capacity > 0 AND remaining_capacity < 5 ORDER BY remaining_capacity ASC",
"intent": "Advanced sessions that are almost full (remaining capacity less than 5)",
"manifest": "Advanced sessions that are almost full (remaining capacity less than 5)",
"parameterized": {
"parameterized_intent": "$1 sessions that are almost full (remaining capacity less than 5)",
"parameterized_sql": "SELECT session_name, remaining_capacity, session_date, session_start_time FROM public.session WHERE learning_level = $1 AND remaining_capacity > 0 AND remaining_capacity < 5 ORDER BY remaining_capacity ASC"
}
},
{
"nlQuery": "Find sessions about Gemini",
"sql": "SELECT name, format, session_date, description FROM ((SELECT s1.session_name AS name, s1.session_format AS format, s1.session_date AS session_date, s1.full_description AS description, (s1.full_description_embedding <=> public.embedding('text-embedding-005', 'Gemini')::public.vector) AS distance FROM public.session s1 ORDER BY distance LIMIT 10) UNION ALL (SELECT s2.session_name AS name, s2.session_format AS format, s2.session_date AS session_date, t.topic_desc AS description, (t.embedding <=> public.embedding('text-embedding-005', 'Gemini')::public.vector) AS distance FROM public.session s2 INNER JOIN public.session_topic_mapping stm ON s2.session_id = stm.session_id INNER JOIN public.session_topic t ON stm.topic = t.topic ORDER BY distance LIMIT 10)) AS combined_results ORDER BY distance LIMIT 10",
"intent": "Find sessions about Gemini",
"manifest": "Find sessions about a given topic",
"parameterized": {
"parameterized_intent": "Find sessions about $1",
"parameterized_sql": "SELECT name, format, session_date, description FROM ((SELECT s1.session_name AS name, s1.session_format AS format, s1.session_date AS session_date, s1.full_description AS description, (s1.full_description_embedding <=> public.embedding('text-embedding-005', '$1')::public.vector) AS distance FROM public.session s1 ORDER BY distance LIMIT 10) UNION ALL (SELECT s2.session_name AS name, s2.session_format AS format, s2.session_date AS session_date, t.topic_desc AS description, (t.embedding <=> public.embedding('text-embedding-005', '$1')::public.vector) AS distance FROM public.session s2 INNER JOIN public.session_topic_mapping stm ON s2.session_id = stm.session_id INNER JOIN public.session_topic t ON stm.topic = t.topic ORDER BY distance LIMIT 10)) AS combined_results ORDER BY distance LIMIT 10"
}
}
]
}
在 AlloyDB Studio 中載入 QueryData 脈絡資料
如要使用「查詢資料」環境,我們需要透過 AlloyDB Studio 將資料上傳至資料庫。
- 在 Google Cloud 控制台中開啟 AlloyDB Studio。
- 左側面板底部會顯示「內容集」和三點圖示。
- 按一下該圖示,然後選擇「建立內容集」。
- 填寫對話方塊:
- Name (名稱):
conference_context - 說明:
Conference Sessions QueryData Context - 上傳結構定義檔案:上傳使用上述內容建立的 JSON 檔案。
- Name (名稱):
- 儲存
測試 QueryData 脈絡資料
上傳後,即可直接在 AlloyDB Studio 中測試。
- 點選剛建立的脈絡旁的三點圖示,然後選擇「測試脈絡集」 (或在查詢編輯器中使用 Gemini 藥丸,然後選取這個脈絡)。
- 在 Gemini SQL 程式碼生成提示中,輸入符合範本的自然語言查詢:
Advanced sessions that are almost full - 產生 SQL,並確認是否與我們提供的範本相符。
- 在自然語言提示中將「進階」變更為「初學者」,然後試試參數化查詢,看看是否會調整!
11. 清理
刪除 AlloyDB 叢集
如要避免系統持續向您的 Google Cloud 帳戶收費,請刪除本程式碼研究室建立的資源。
在 Cloud Shell 中執行下列指令,刪除 AlloyDB 叢集 (這也會刪除執行個體):
export REGION=us-central1
export ADBCLUSTER=alloydb-next26-ai-demo-01
echo "=> Deleting AlloyDB Cluster (${ADBCLUSTER})..."
gcloud alloydb clusters delete $ADBCLUSTER --region=$REGION --force
或者,如果您是特地為了這個程式碼研究室建立專案,可以刪除整個專案。
刪除 IP 範圍和 vpc-peering
PROJECT_ID=$(gcloud config get-value project)
echo "=> Deleting Service Networking VPC Peering..."
gcloud compute networks peerings delete servicenetworking-googleapis-com \
--network=default \
--project=${PROJECT_ID} --quiet || true
echo "=> Deleting Allocated IP Range for Managed Services..."
gcloud compute addresses delete psa-range \
--global \
--project=${PROJECT_ID} --quiet || true
刪除本機檔案
刪除在 Work with QueryData in AlloyDB Studio 步驟中建立的本機 JSON 檔案。
12. 恭喜
恭喜!您已成功使用統一的會議工作階段情境,探索多項 AlloyDB AI 功能。
涵蓋內容
- 如何啟用及使用 AI 函式 (
ai.if、ai.rank) 進行語意篩選和評分。 - 如何使用 ScaNN (向量) 和 RUM (文字) 索引,透過倒數排名融合 (RRF) 導入混合搜尋。
- 瞭解如何在 AlloyDB Studio 中使用 QueryData,透過自然語言生成可預測的 SQL。
後續步驟
- 參閱 AlloyDB AI 說明文件。
- 進一步瞭解 pgvector 和 ScaNN。