Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
赵月辉
/
fastgpt-migrated
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Unverified
Commit
f10e8775
authored
Jul 07, 2023
by
archer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
init.sql
parent
a04b6618
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
docs/deploy/fastgpt/pg/init.sql
+4
-4
No files found.
docs/deploy/fastgpt/pg/init.sql
View file @
f10e8775
...
@@ -3,7 +3,7 @@ psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-E
...
@@ -3,7 +3,7 @@ psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-E
CREATE
EXTENSION
IF
NOT
EXISTS
vector
;
CREATE
EXTENSION
IF
NOT
EXISTS
vector
;
-- init table
-- init table
CREATE
TABLE
IF
NOT
EXISTS
model
D
ata
(
CREATE
TABLE
IF
NOT
EXISTS
model
d
ata
(
id
BIGSERIAL
PRIMARY
KEY
,
id
BIGSERIAL
PRIMARY
KEY
,
vector
VECTOR
(
1536
)
NOT
NULL
,
vector
VECTOR
(
1536
)
NOT
NULL
,
user_id
VARCHAR
(
50
)
NOT
NULL
,
user_id
VARCHAR
(
50
)
NOT
NULL
,
...
@@ -13,9 +13,9 @@ CREATE TABLE IF NOT EXISTS modelData (
...
@@ -13,9 +13,9 @@ CREATE TABLE IF NOT EXISTS modelData (
a
TEXT
NOT
NULL
a
TEXT
NOT
NULL
);
);
-- 索引设置,按需取
-- 索引设置,按需取
-- CREATE INDEX IF NOT EXISTS model
Data_userId_index ON modelD
ata USING HASH (user_id);
-- CREATE INDEX IF NOT EXISTS model
data_userId_index ON modeld
ata USING HASH (user_id);
-- CREATE INDEX IF NOT EXISTS model
Data_kbId_index ON modelD
ata USING HASH (kb_id);
-- CREATE INDEX IF NOT EXISTS model
data_kbId_index ON modeld
ata USING HASH (kb_id);
-- CREATE INDEX IF NOT EXISTS idx_model_data_md5_q_a_user_id_kb_id ON model
D
ata (md5(q), md5(a), user_id, kb_id);
-- CREATE INDEX IF NOT EXISTS idx_model_data_md5_q_a_user_id_kb_id ON model
d
ata (md5(q), md5(a), user_id, kb_id);
-- CREATE INDEX modeldata_id_desc_idx ON modeldata (id DESC);
-- CREATE INDEX modeldata_id_desc_idx ON modeldata (id DESC);
-- vector 索引,可以参考 [pg vector](https://github.com/pgvector/pgvector) 去配置,根据数据量去配置
-- vector 索引,可以参考 [pg vector](https://github.com/pgvector/pgvector) 去配置,根据数据量去配置
EOSQL
EOSQL
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment