Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[YSQL] Rebuild the index using reindex if it gets invalidated #10267

Open
adil246 opened this issue Oct 12, 2021 · 0 comments
Open

[YSQL] Rebuild the index using reindex if it gets invalidated #10267

adil246 opened this issue Oct 12, 2021 · 0 comments
Assignees
Labels
area/ysql Yugabyte SQL (YSQL) kind/enhancement This is an enhancement of an existing feature priority/medium Medium priority issue

Comments

@adil246
Copy link
Contributor

adil246 commented Oct 12, 2021

Jira Link: DB-983
Issue
Support index rebuilt using Reindex or Reindex concurrently if the index is in an invalid state due to invalid data, corruption, or failure to build. In the below example, it fails to create an index, marked as invalid, but the index table gets created.

yugabyte=# \d foo;
                           Table "public.foo"
 Column |       Type        | Collation | Nullable |      Default
--------+-------------------+-----------+----------+--------------------
 id     | uuid              |           | not null | uuid_generate_v1()
 b      | character varying |           |          |
Indexes:
    "foo_pkey" PRIMARY KEY, lsm (id HASH)
    "foo_b_idx" UNIQUE, lsm (b HASH) INVALID

yugabyte=# explain analyze select * from foo where b='jsmith';
                                            QUERY PLAN
---------------------------------------------------------------------------------------------------
 Seq Scan on foo  (cost=0.00..102.50 rows=1000 width=48) (actual time=4.376..6.159 rows=1 loops=1)
   Filter: ((b)::text = 'jsmith'::text)
   Rows Removed by Filter: 1
 Planning Time: 0.047 ms
 Execution Time: 6.227 ms
(5 rows)

yugabyte=# reindex index foo_b_idx;
ERROR:  REINDEX not supported yet
LINE 1: reindex index foo_b_idx;
        ^
HINT:  Please report the issue on https://github.com/YugaByte/yugabyte-db/issues
yugabyte=#

yugabyte=# reindex index concurrently foo_b_idx;
ERROR:  syntax error at or near "concurrently"
LINE 1: reindex index concurrently foo_b_idx;

 ./yb-admin --master_addresses 127.0.0.1:7100,127.0.0.2:7100,127.0.03:7100 list_tables include_db_type include_table_id include_table_type |grep -i idx
ysql.yugabyte.foo_b_idx 000030af000030008000000000004014 index

index_table_on_UI

@adil246 adil246 added the area/ysql Yugabyte SQL (YSQL) label Oct 12, 2021
@yugabyte-ci yugabyte-ci added kind/bug This issue is a bug priority/medium Medium priority issue labels Jun 8, 2022
@yugabyte-ci yugabyte-ci added kind/enhancement This is an enhancement of an existing feature and removed kind/bug This issue is a bug labels Sep 18, 2022
priyanshi-yb added a commit to yugabyte/yb-voyager that referenced this issue Feb 1, 2023
priyanshi-yb added a commit to yugabyte/yb-voyager that referenced this issue Feb 1, 2023
priyanshi-yb added a commit to yugabyte/yb-voyager that referenced this issue Feb 3, 2023
priyanshi-yb added a commit to yugabyte/yb-voyager that referenced this issue Feb 7, 2023
…761)

* refactored the analyze-schema regexes as mentioned in the issue #761 
* added automation tests in analyze-schema test
* removed test case for the CREATE INDEX CONCURRENTLY
* changed the case for REINDEX CONCURRENTLY to REINDEX anything as any REINDEX is not supported (yugabyte/yugabyte-db#10267)
@yugabyte-ci yugabyte-ci changed the title [YSQL]Rebuild the index using reindex if it gets invalidated [YSQL] Rebuild the index using reindex if it gets invalidated Aug 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ysql Yugabyte SQL (YSQL) kind/enhancement This is an enhancement of an existing feature priority/medium Medium priority issue
Projects
Status: No status
Development

No branches or pull requests

3 participants