이 문서에서는 ScaNN 색인을 생성할 때 발생할 수 있는 오류를 설명합니다. 오류의 예시와 권장 해결 방법도 제공됩니다.
오류 목록
다음은 ScaNN 색인을 만들려고 할 때 생성되는 오류 목록입니다. 이러한 오류의 생성을 사용 중지하고 색인을 계속 생성할 수 있습니다. 자세한 내용은 색인 생성 적용 및 오류 억제를 참고하세요.
ERROR: 빈 테이블로 ScaNN 색인을 만들 수 없음
오류 메시지
데이터가 없는 테이블에 색인을 생성하거나 생성된 ScaNN 색인이 있는 테이블을 자르려고 하면 다음 오류가 발생합니다.
ERROR: Cannot create ScaNN index with empty table. Once the table is populated
with data, create the index. See documentation to bypass this validation.
ScaNN 색인을 생성하기 전에 테이블에 임베딩 벡터가 채워져 있는지 확인합니다. 테이블의 행 수가 num_leaves 매개변수에 정의된 값보다 큰 것이 좋습니다.
ERROR: 상위 파티션 테이블에 ScaNN 색인을 만들 수 없습니다.
오류 메시지
상위 테이블에서 파티션을 나눈 테이블을 만든 경우 상위 테이블에 ScaNN 색인을 만들면 다음과 같은 오류가 발생합니다.
ERROR: Cannot create ScaNN index on parent partition table. Create ScaNN
indexes on the child tables instead. See documentation to bypass this
validation.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-09-05(UTC)"],[[["\u003cp\u003eThis document outlines potential errors encountered when creating a \u003ccode\u003eScaNN\u003c/code\u003e index, including issues with empty tables, insufficient data rows, and attempts to index parent partition tables.\u003c/p\u003e\n"],["\u003cp\u003eA common fix for issues when generating a \u003ccode\u003eScaNN\u003c/code\u003e index is to ensure that the table contains an adequate amount of data, especially embedding vectors.\u003c/p\u003e\n"],["\u003cp\u003eCreating a \u003ccode\u003eScaNN\u003c/code\u003e index on an empty table or truncating a table with an existing \u003ccode\u003eScaNN\u003c/code\u003e index will result in an error, and the table needs to be populated before indexing.\u003c/p\u003e\n"],["\u003cp\u003eAttempting to create a \u003ccode\u003eScaNN\u003c/code\u003e index on a parent partition table is not allowed; instead, indexes should be created on the individual child partition tables.\u003c/p\u003e\n"],["\u003cp\u003eWhile it is possible to force the creation of a \u003ccode\u003eScaNN\u003c/code\u003e index and suppress errors by setting \u003ccode\u003escann.allow_blocked_operations\u003c/code\u003e to \u003ccode\u003etrue\u003c/code\u003e and assigning \u003ccode\u003eSUPERUSER\u003c/code\u003e privileges, this can lead to poor index performance and slower write speeds.\u003c/p\u003e\n"]]],[],null,["# Troubleshoot ScaNN index errors\n\nThis document describes errors you might encounter when you generate a `ScaNN` index. Examples of errors and recommended fixes are also provided.\n\n\u003cbr /\u003e\n\nList of errors\n--------------\n\nThe following a list of errors that are generated when you try to create a\n`ScaNN` index. You can disable generation of these errors and continue to generate\nthe index. For more information, see [Enforce index creation and suppress errors](#enforce-index-creation).\n\n### ERROR: Cannot create ScaNN index with empty table\n\n#### Error message\n\nWhen you try to generate an index on a table with no data or try to truncate a\ntable with a `ScaNN` index generated on it, the following error occurs:\n\n`ERROR: Cannot create ScaNN index with empty table. Once the table is populated\nwith data, create the index. See documentation to bypass this validation.`\n\n#### Sample queries that cause the error\n\n- Query Example A\n\n create table t1 (a INT, b VECTOR(512));\n CREATE TABLE\n create index on t1 using ScaNN(b cosine) with (num_leaves = 10, quantizer = 'sq8');\n\n- Query Example B\n\n truncate t1;\n\n#### Recommended fix\n\nMake sure that your table is populated with embedding vectors before you generate a `ScaNN` index.\n\n### ERROR: Cannot create ScaNN index\n\n#### Error message\n\nWhen you try to generate an index on a table with few rows populated, the\nfollowing error occurs:\n\n`Cannot create ScaNN index, error: INVALID_ARGUMENT: Number of row (5) must be\nlarger than (1000).`\n\n#### Sample query that causes the error\n\n create table t1 (a INT, b VECTOR(512));\n CREATE TABLE\n insert into t1 select (random()*1e9)::int, random_vector(512) from generate_series(1, 5);\n INSERT 0 5\n create index on t1 using scann(b cosine) with (num_leaves = 100, quantizer = 'sq8');\n\n#### Recommended fix\n\nEnsure that your table is populated with embedding vectors before you generate a\n`ScaNN` index. We recommend that the number of rows in the table are greater\nthan the value defined in the `num_leaves` parameter.\n\n### ERROR: Cannot create ScaNN index on parent partition table.\n\n#### Error message\n\nIf you have created partitioned tables from a parent table, then creating a\nScaNN index on the parent table generates the following error:\n\n`ERROR: Cannot create ScaNN index on parent partition table. Create ScaNN\nindexes on the child tables instead. See documentation to bypass this\nvalidation.`\n\n#### Sample query that causes the error\n\n create table t1 (a INT, b VECTOR(512)) partition by range(a);\n CREATE TABLE\n CREATE TABLE t1_one_ten PARTITION of t1 for values from (1) to (10);\n CREATE TABLE\n insert into t1_one_ten select (random()*1e9)::int, random_vector(512) from generate_series(1, 100);\n INSERT 0 100\n CREATE TABLE t1_eleven_twenty PARTITION of t1 for values from (11) to (20);\n CREATE TABLE\n insert into t1_eleven_twenty select (random()*1e9)::int, random_vector(512) from generate_series(1, 100);\n INSERT 0 100\n create index on t1 using scann(b cosine) with (num_leaves = 10, quantizer = 'sq8');\n\n#### Recommended fix\n\nYou can't generate a `ScaNN` index on the parent table of a partitioned table.\nYou must generate the `ScaNN` indexes on the partitioned table.\n\nEnforce index creation and suppress errors\n------------------------------------------\n\nYou can enforce AlloyDB to generate an index and suppress errors. Before\nallowing index generation with this method, consider the following implications:\n\n- Since the index is trained on less or no data, centroids learn on zero data leading to bad recall.\n- The write performance to the database might also be slow.\n\nTo force index generation, complete the following:\n\n1. Set the `scann.allow_blocked_operations creation` session-level parameter\n to `true` on the database:\n\n SET scann.allow_blocked_operations = true;\n\n2. Assign the `SUPERUSER` privilege to the user that will run these queries on the database:\n\n CREATE USER \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-n\"\u003eUSER_NAME\u003c/span\u003e\u003c/var\u003e WITH SUPERUSER PASSWORD \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-n\"\u003ePASSWORD\u003c/span\u003e\u003c/var\u003e;\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003eUSER_NAME\u003c/var\u003e: the name of the user you want to grant the privilege to.\n - \u003cvar translate=\"no\"\u003ePASSWORD\u003c/var\u003e: the password of the user."]]