1. บทนำ
ใน Codelab นี้ คุณจะได้สร้างระบบการค้นหาและแนะนำเซสชันการประชุมอัจฉริยะโดยใช้ AlloyDB สำหรับ PostgreSQL และความสามารถของ AI คุณจะได้เรียนรู้วิธีรวมการค้นหาคีย์เวิร์ดแบบดั้งเดิมเข้ากับการค้นหาแบบเวกเตอร์เชิงความหมายขั้นสูง ใช้ QueryData เพื่อสร้างคำสั่ง SQL ที่คาดการณ์ได้จากภาษาธรรมชาติ และใช้ฟังก์ชันตัวดำเนินการอัจฉริยะ
สิ่งที่คุณต้องดำเนินการ
- ติดตั้งใช้งานคลัสเตอร์ AlloyDB และเปิดใช้ความสามารถของ AI
- โหลดชุดข้อมูลการประชุมและทำความเข้าใจโครงสร้างของชุดข้อมูล
- เปิดใช้ API การเข้าถึงข้อมูล ของ AlloyDB
- ใช้โอเปอเรเตอร์ AI ของ AlloyDB เช่น
ai.ifและai.rankสำหรับการดำเนินการเชิงความหมาย - ใช้การค้นหาแบบไฮบริดที่รวมการค้นหาเวกเตอร์เชิงความหมาย (ScaNN) และข้อความ (RUM)
- เปิดใช้ QueryData สำหรับ AlloyDB
- สร้างเทมเพลต QueryData
- ใช้ QueryData กับ AI Agent
สิ่งที่คุณต้องมี
- เว็บเบราว์เซอร์ เช่น Chrome
- โปรเจ็กต์ Google Cloud ที่เปิดใช้การเรียกเก็บเงิน
Codelab นี้มีไว้สำหรับนักพัฒนาซอฟต์แวร์ทุกระดับ รวมถึงผู้เริ่มต้น
ระยะเวลารวมโดยประมาณ: 60-70 นาที ค่าใช้จ่ายโดยประมาณ: ต่ำกว่า $3 USD (ทรัพยากรที่สร้างในโค้ดแล็บนี้มีสิทธิ์ใช้รุ่นฟรีมาตรฐานหรือช่วงทดลองใช้)
2. การตั้งค่าและข้อกำหนด
การตั้งค่าโปรเจ็กต์
ลงชื่อเข้าใช้ คอนโซล Google Cloud หากยังไม่มีบัญชี Gmail หรือ Google Workspace คุณต้องสร้างบัญชี
ใช้บัญชีส่วนตัวแทนบัญชีงานหรือบัญชีโรงเรียน
สร้างโปรเจ็กต์ Google Cloud
- ในคอนโซล Google Cloud ในหน้าตัวเลือกโปรเจ็กต์ ให้เลือกหรือสร้างโปรเจ็กต์ Google Cloud
- ตรวจสอบว่าได้เปิดใช้การเรียกเก็บเงินสำหรับโปรเจ็กต์ที่อยู่ในระบบคลาวด์แล้ว ดูวิธีตรวจสอบว่าได้เปิดใช้การเรียกเก็บเงินในโปรเจ็กต์แล้วหรือไม่
เริ่มต้น Cloud Shell
แม้ว่าคุณจะใช้งาน Google Cloud จากระยะไกลจากแล็ปท็อปได้ แต่ใน Codelab นี้คุณจะใช้ Google Cloud Shell ซึ่งเป็นสภาพแวดล้อมบรรทัดคำสั่งที่ทำงานในระบบคลาวด์
- คลิกเปิดใช้งาน Cloud Shell ที่ด้านบนของคอนโซล Google Cloud
- ยืนยันการตรวจสอบสิทธิ์
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 สำหรับ PostgreSQL ได้ โดยให้บริการฐานข้อมูลที่เข้ากันได้กับ PostgreSQL ซึ่งมีการจัดการครบวงจร ออกแบบมาสำหรับภาระงานด้านการทำธุรกรรมและการวิเคราะห์ขององค์กรที่ต้องการประสิทธิภาพสูง - Compute Engine API (
compute.googleapis.com) ช่วยให้คุณสร้างและจัดการเครื่องเสมือน (VM), Persistent Disk และการตั้งค่าเครือข่ายได้ โดยมีพื้นฐานด้านโครงสร้างพื้นฐานในฐานะบริการ (IaaS) หลักที่จำเป็นต่อการเรียกใช้ภาระงานและโฮสต์โครงสร้างพื้นฐานเบื้องหลังสำหรับบริการที่มีการจัดการจำนวนมาก - Cloud Resource Manager API (
cloudresourcemanager.googleapis.com) ช่วยให้คุณจัดการข้อมูลเมตาและการกำหนดค่าของโปรเจ็กต์ที่อยู่ในระบบคลาวด์ Google แบบเป็นโปรแกรมได้ ซึ่งช่วยให้คุณจัดระเบียบทรัพยากร จัดการนโยบาย Identity and Access Management (IAM) และตรวจสอบสิทธิ์ในลำดับชั้นของโปรเจ็กต์ได้ - Service Networking API (
servicenetworking.googleapis.com) ช่วยให้คุณตั้งค่าการเชื่อมต่อส่วนตัวระหว่างเครือข่าย Virtual Private Cloud (VPC) กับบริการที่มีการจัดการของ Google โดยอัตโนมัติได้ โดยเฉพาะอย่างยิ่งจำเป็นต้องสร้างการเข้าถึง IP ส่วนตัวสำหรับบริการต่างๆ เช่น AlloyDB เพื่อให้สื่อสารกับทรัพยากรอื่นๆ ได้อย่างปลอดภัย - Vertex AI API (
aiplatform.googleapis.com) ช่วยให้แอปพลิเคชันของคุณสร้าง ทำให้ใช้งานได้ และปรับขนาดโมเดลแมชชีนเลิร์นนิงได้ โดยมีอินเทอร์เฟซแบบรวมสำหรับบริการ AI ทั้งหมดของ Google Cloud รวมถึงสิทธิ์เข้าถึงโมเดล Generative AI (เช่น Gemini) และการฝึกโมเดลที่กำหนดเอง - Data Analytics API (
geminidataanalytics.googleapis.com) ช่วยให้แอปพลิเคชันของคุณใช้ความสามารถของ AI ทั่วไปในการวิเคราะห์ข้อมูลในผลิตภัณฑ์ BI ได้
4. จัดสรร AlloyDB
สร้างคลัสเตอร์และอินสแตนซ์หลักของ AlloyDB
สร้างช่วง IP ส่วนตัว
AlloyDB ต้องใช้ช่วง IP ส่วนตัวใน VPC หากคุณใช้defaultเครือข่าย VPC ให้ทำดังนี้
- สร้างช่วง 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
- สร้างคลัสเตอร์ทดลองใช้ฟรี ("TRIAL") หรือคลัสเตอร์มาตรฐาน ("STANDARD") หากไม่ใช่ครั้งแรก
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
คุณต้องเปิดใช้ Data Access API ในคลัสเตอร์ AlloyDB เพื่อให้ใช้บริบท 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
- ไปที่หน้า AlloyDB for Postgres ในคอนโซล Google Cloud
- คลิกอินสแตนซ์หลัก
- คลิก AlloyDB Studio ในการนำทางด้านซ้าย
- เลือกฐานข้อมูล
postgres - ตรวจสอบสิทธิ์ด้วย
IAM database authentication
สร้างฐานข้อมูล
เรียกใช้ SQL ต่อไปนี้ในตัวแก้ไขคำค้นหา
CREATE DATABASE conference_db;
เปลี่ยนไปใช้ฐานข้อมูล conference_db โดยทำดังนี้
- คลิกปุ่ม
Current userที่ด้านซ้ายบนของหน้าจอAlloyDB studio - คลิกปุ่ม
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 ในฐานข้อมูล
เรียกใช้ SQL ต่อไปนี้ใน AlloyDB Studio (conference_db context)
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 ด้วยฟังก์ชัน ai.if และ ai.rank กัน
การกรองเชิงความหมายด้วย ai.if
การจับคู่ข้อความมาตรฐานอาจพลาดเซสชันหากไม่มีคีย์เวิร์ดที่ตรงกันทุกประการ มาค้นหาเซสชันเกี่ยวกับ "Generative AI" โดยใช้ ai.if กัน
เรียกใช้ SQL ต่อไปนี้ใน AlloyDB Studio
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. ใช้การค้นหาแบบไฮบริด
การค้นหาแบบไฮบริดรวมความแม่นยำของการค้นหาคีย์เวิร์ด (คำศัพท์) เข้ากับความเข้าใจตามบริบทของการค้นหาเวกเตอร์ (ความหมาย) เราจะสร้างดัชนีสำหรับทั้งสองและใช้ Reciprocal Rank Fusion (RRF) เพื่อผสานผลลัพธ์
เปิดใช้การสแกน
ตรวจสอบว่าได้เปิดใช้ส่วนขยาย scann และ rum แล้ว
CREATE EXTENSION IF NOT EXISTS alloydb_scann;
CREATE EXTENSION IF NOT EXISTS rum;
สร้างดัชนี
เนื่องจากสคีมาของเราใช้คอลัมน์ที่สร้างขึ้นสำหรับ Embedding (full_description_embedding) ระบบจึงคำนวณโดยอัตโนมัติเมื่อมีการแทรก เราเพียงแค่ต้องสร้างดัชนีที่เหมาะสมเพื่อให้ดึงข้อมูลได้อย่างรวดเร็ว
สร้างดัชนี RUM (ดัชนี FTS) สำหรับการค้นหาคีย์เวิร์ดแบบข้อความแบบเต็ม และดัชนี ScaNN สำหรับการค้นหาความคล้ายคลึงของเวกเตอร์อย่างรวดเร็ว
เรียกใช้ SQL ต่อไปนี้ใน AlloyDB Studio
-- 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 แต่จะเน้นที่ ScaNN ของ AlloyDB
เราจะใช้การค้นหาเชิงความหมายและการค้นหาคีย์เวิร์ด และผสานผลลัพธ์โดยใช้ 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. ทำงานกับ QueryData ใน AlloyDB Studio
AlloyDB AI ช่วยให้คุณใช้ QueryData เพื่อสร้างคำสั่ง SQL ที่แม่นยำและคาดการณ์ได้จากอินพุตภาษาธรรมชาติ ในส่วนนี้ คุณจะได้เรียนรู้วิธีสร้างบริบท (เทมเพลต) QueryData และทดสอบโดยตรงใน AlloyDB Studio
สร้างบริบท QueryData
บริบท QueryData เป็นไฟล์ 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"
}
}
]
}
โหลดบริบท QueryData ใน AlloyDB Studio
หากต้องการใช้บริบทข้อมูลการค้นหา เราต้องอัปโหลดไปยังฐานข้อมูลผ่าน AlloyDB Studio
- เปิด AlloyDB Studio ในคอนโซล Google Cloud
- ที่แผงด้านซ้ายล่าง คุณจะเห็นชุดบริบทและจุด 3 จุด
- คลิกที่ข้อความนั้น แล้วเลือกสร้างชุดบริบท
- กรอกข้อมูลในกล่องโต้ตอบ
- ชื่อ:
conference_context - คำอธิบาย:
Conference Sessions QueryData Context - อัปโหลดไฟล์บริบท: อัปโหลดไฟล์ JSON ที่สร้างขึ้นด้วยเนื้อหาด้านบน
- ชื่อ:
- บันทึก
ทดสอบบริบท QueryData
เมื่ออัปโหลดแล้ว คุณจะทดสอบได้โดยตรงใน AlloyDB Studio
- คลิกจุด 3 จุดข้างบริบทที่เพิ่งสร้าง แล้วเลือกทดสอบชุดบริบท (หรือใช้เม็ดยา Gemini ในเครื่องมือแก้ไขคำค้นหา แล้วเลือกบริบทนี้)
- ในพรอมต์การสร้าง SQL ของ Gemini ให้พิมพ์คำค้นหาในภาษาธรรมชาติที่ตรงกับเทมเพลตของเรา
Advanced sessions that are almost full - สร้าง SQL และตรวจสอบว่าตรงกับเทมเพลตที่เราให้ไว้
- ลองใช้การค้นหาแบบพารามิเตอร์โดยเปลี่ยน "ขั้นสูง" เป็น "เริ่มต้น" ในพรอมต์ภาษาธรรมชาติ แล้วดูว่าระบบจะปรับเปลี่ยนหรือไม่
11. ล้างข้อมูล
ลบคลัสเตอร์ AlloyDB
โปรดลบทรัพยากรที่สร้างขึ้นระหว่างการทำ Codelab นี้เพื่อหลีกเลี่ยงการเรียกเก็บเงินอย่างต่อเนื่องในบัญชี 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
หรือหากสร้างโปรเจ็กต์สำหรับ Codelab นี้โดยเฉพาะ คุณสามารถลบทั้งโปรเจ็กต์ได้
ลบช่วง IP และการ Peering VPC
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
ลบไฟล์ในเครื่อง
ลบไฟล์ JSON ในเครื่องที่สร้างขึ้นในWork with QueryData in AlloyDB Studioขั้นตอน
12. ขอแสดงความยินดี
ยินดีด้วย คุณได้สำรวจความสามารถหลายอย่างของ AlloyDB AI โดยใช้สถานการณ์เซสชันการประชุมแบบรวมศูนย์เรียบร้อยแล้ว
สิ่งที่เราได้พูดถึง
- วิธีเปิดใช้และใช้ฟังก์ชัน AI (
ai.if,ai.rank) เพื่อการกรองและการให้คะแนนเชิงความหมาย - วิธีใช้ Hybrid Search โดยใช้ดัชนี ScaNN (เวกเตอร์) และ RUM (ข้อความ) กับ Reciprocal Rank Fusion (RRF)
- วิธีใช้ QueryData ใน AlloyDB Studio เพื่อสร้าง SQL ที่คาดการณ์ได้จากภาษาธรรมชาติ
ขั้นตอนถัดไป
- ดูเอกสารประกอบของ AlloyDB AI
- ดูข้อมูลเพิ่มเติมเกี่ยวกับ pgvector และ ScaNN