Index

public.course_embeddings

Description

Used for semantically finding courses, holding embedding vectors

Columns

Name Type Default Nullable Children Parents Comment
course_id uuid false public.courses Embeddings belong to a specific course.
created_at timestamp with time zone now() false Timestamp when the record was created.
deleted_at timestamp with time zone true Timestamp when the record was deleted. If null, the record is not deleted.
description_embedding vector(1536) true Embedding vector of the course description.
id uuid uuid_generate_v4() false A unique, stable identifier for the record.
title_embedding vector(1536) true Embedding vector of the course title.
updated_at timestamp with time zone now() false Timestamp when the record was last updated. The field is updated automatically by the set_timestamp trigger.

Constraints

Name Type Definition
course_embeddings_course_id_fkey FOREIGN KEY FOREIGN KEY (course_id) REFERENCES courses(id)
course_embeddings_course_id_not_null n NOT NULL course_id
course_embeddings_created_at_not_null n NOT NULL created_at
course_embeddings_id_not_null n NOT NULL id
course_embeddings_pkey PRIMARY KEY PRIMARY KEY (id)
course_embeddings_updated_at_not_null n NOT NULL updated_at

Indexes

Name Definition
course_embeddings_active_course_id_idx CREATE UNIQUE INDEX course_embeddings_active_course_id_idx ON public.course_embeddings USING btree (course_id) WHERE (deleted_at IS NULL)
course_embeddings_description_embedding_idx CREATE INDEX course_embeddings_description_embedding_idx ON public.course_embeddings USING hnsw (description_embedding vector_ip_ops) WHERE (deleted_at IS NULL)
course_embeddings_pkey CREATE UNIQUE INDEX course_embeddings_pkey ON public.course_embeddings USING btree (id)
course_embeddings_title_embedding_idx CREATE INDEX course_embeddings_title_embedding_idx ON public.course_embeddings USING hnsw (title_embedding vector_ip_ops) WHERE (deleted_at IS NULL)

Triggers

Name Definition
set_timestamp CREATE TRIGGER set_timestamp BEFORE UPDATE ON public.course_embeddings FOR EACH ROW EXECUTE FUNCTION trigger_set_timestamp()

Relations

er

Generated by tbls