clear-code / redmine_full_text_search

Full text search for Redmine
MIT License
61 stars 24 forks source link

Exceeds PostgreSQL index size limit #96

Closed ryouma-nagare closed 3 years ago

ryouma-nagare commented 3 years ago

I get an error when I run the following command in version 1.0.4.

bundle exec rake full_text_search:similar_issues:synchronize RAILS_ENV=production

Error Message ERROR: index row requires 8880 bytes, maximum size is 8191

This is an error that occurred in issue_contents. I think it is necessary to limit the data length that can be stored in a text type column.

db_redmine=> \d issue_contents
                              Table "public.issue_contents"
   Column   |  Type   | Collation | Nullable |                  Default
------------+---------+-----------+----------+--------------------------------------------
 id         | integer |           | not null | nextval('issue_contents_id_seq'::regclass)
 project_id | integer |           |          |
 issue_id   | integer |           | not null |
 subject    | text    |           |          |
 contents   | text    |           |          |
 status_id  | integer |           |          |
 is_private | boolean |           |          |
Indexes:
    "issue_contents_pkey" PRIMARY KEY, btree (id)
    "index_issue_contents_pgroonga" pgroonga (id, project_id, issue_id, subject, contents, status_id, is_private) WITH (tokenizer='TokenMecab', normalizer='NormalizerNFKC121')

Redmine plugins: full_text_search 1.0.4


- Packages

$ rpm -qa |grep postgresql postgresql13-libs-13.2-1PGDG.rhel7.x86_64 postgresql13-devel-13.2-1PGDG.rhel7.x86_64 postgresql13-pgdg-pgroonga-2.2.8-1.el7.x86_64 postgresql13-13.2-1PGDG.rhel7.x86_64 postgresql13-server-13.2-1PGDG.rhel7.x86_64 postgresql10-libs-10.16-1PGDG.rhel7.x86_64 postgresql13-contrib-13.2-1PGDG.rhel7.x86_64

$ rpm -qa |grep groonga groonga-release-2020.1.29-1.noarch groonga-11.0.0-1.el7.x86_64 postgresql13-pgdg-pgroonga-2.2.8-1.el7.x86_64 groonga-libs-11.0.0-1.el7.x86_64 groonga-tokenizer-mecab-11.0.0-1.el7.x86_64 groonga-plugin-suggest-11.0.0-1.el7.x86_64

kou commented 3 years ago

Could you identify SQL that causes the error?

ryouma-nagare commented 3 years ago

bundle exec rake full_text_search:similar_issues:synchronize RAILS_ENV=production Task is aborted

So I tried to check issue_contents and ran the following SQL and got an error

db_redmine=> select count(*) from issue_contents;
ERROR: index row requires 8880 bytes, maximum size is 8191
kou commented 3 years ago

Thanks. It's a PGroonga problem. We'll fix it in PGroonga.

kou commented 3 years ago

PGroonga 2.2.9 has been released. Could you try it?