Skip to content
This repository has been archived by the owner on Apr 2, 2024. It is now read-only.

Unable to index large tag values #1091

Closed
jgpruitt opened this issue Jan 28, 2022 · 4 comments
Closed

Unable to index large tag values #1091

jgpruitt opened this issue Jan 28, 2022 · 4 comments
Assignees
Labels
Bug Something isn't working

Comments

@jgpruitt
Copy link
Contributor

Seeing a fair number of these in the opentelemetry-demo

UNIQUE CONSTRAINT, btree (key, value) INCLUDE (id, key_id) on tag partitions

STATEMENT:  SELECT ps_trace.put_tag($1, $2, $3::ps_trace.tag_type)
ERROR:  index row size 4608 exceeds btree version 4 maximum 2704 for index "tag_63_key_value_id_key_id_key"
DETAIL:  Index row references tuple (0,37) in relation "tag_63".
HINT:  Values larger than 1/3 of a buffer page cannot be indexed.
	Consider a function index of an MD5 hash of the value, or use full text indexing.
CONTEXT:  SQL statement "INSERT INTO _ps_trace.tag as t (tag_type, key_id, key, value)
	        SELECT
	            _tag_type,
	            k.id,
	            _key,
	            _value
	        FROM _ps_trace.tag_key k
	        WHERE k.key = _key
	        ON CONFLICT (key, value) DO
	        UPDATE SET tag_type = t.tag_type | EXCLUDED.tag_type
	        WHERE t.tag_type & EXCLUDED.tag_type = 0"
	PL/pgSQL function put_tag(tag_k,tag_v,tag_type) line 12 at SQL statement
@jgpruitt jgpruitt self-assigned this Jan 28, 2022
@jgpruitt jgpruitt added the Bug Something isn't working label Jan 28, 2022
@cevian
Copy link
Contributor

cevian commented Jan 28, 2022

what is this index used for?

@jgpruitt
Copy link
Contributor Author

The primary use is to prevent duplicate entries of the same key-value pair.

@jgpruitt
Copy link
Contributor Author

I guess we COULD use a hash of the value to put a unique index on, but that's annoying. Not sure what else we could do though.

@cevian
Copy link
Contributor

cevian commented Mar 11, 2022

Closing in favor of timescale/promscale_extension#128

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants