MySQL Forums
Forum List  »  Perl

Can't display comment for table index
Posted by: barry kimelman
Date: April 26, 2022 11:59AM

I created a table as follows

CREATE TABLE contacts(
contact_id INT AUTO_INCREMENT,
first_name VARCHAR(100) NOT NULL,
last_name VARCHAR(100) NOT NULL,
email VARCHAR(100),
phone VARCHAR(20),
PRIMARY KEY(contact_id),
UNIQUE(email),
INDEX phone(phone) INVISIBLE,
INDEX name(first_name, last_name) comment 'By first name and/or last name'
);

When I run a query to retrieve the info for the index the comment is not displayed.

select index_schema,
index_name,
group_concat(column_name order by seq_in_index) as index_columns,
index_type,
case non_unique
when 1 then 'Not Unique'
else 'Unique'
end as is_unique,
table_name,
comment
from information_schema.statistics
where table_schema not in ('information_schema', 'mysql',
'performance_schema', 'sys')
and table_name = 'contacts'
group by index_schema,
index_name,
index_type,
non_unique,
table_name,
comment
order by index_schema,
index_name;


Why can't I retrieve the comment associated with the index ?

Options: ReplyQuote


Subject
Written By
Posted
Can't display comment for table index
April 26, 2022 11:59AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.