{"issue":{"user":{"id":1080242,"login":"malamut2","url":"https://api.github.com/users/malamut2","avatar_url":"https://secure.gravatar.com/avatar/6f4f987119e2cf2e4e0f9200f3d9f83a?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"6f4f987119e2cf2e4e0f9200f3d9f83a"},"milestone":null,"created_at":"2011-12-06T16:00:23Z","title":"Make Token.MAXLEN configurable","labels":[{"name":"nice2have","url":"https://api.github.com/repos/BaseXdb/basex/labels/nice2have","color":"F0D030"},{"name":"Storage","url":"https://api.github.com/repos/BaseXdb/basex/labels/Storage","color":"008800"}],"state":"closed","updated_at":"2011-12-20T21:18:56Z","id":2463827,"html_url":"https://github.com/BaseXdb/basex/issues/305","closed_at":"2011-12-11T05:16:16Z","pull_request":{"patch_url":null,"html_url":null,"diff_url":null},"body":"I ran across the constant Token.MAXLEN which defines the maximal string length up to which hash codes will be calculated, and up to which strings will even appear in indices. This constant is currently of type byte. I suggest that you change this to int, and make the value configurable. This could be achieved with minimal additional code by using a variable optionally defined at the command line with -D. The default should stay at 96.\r\n\r\nBackground: in some cases, IDs may be longer than 96 characters. In our specific use case, we need to use URLs as IDs which have a typical length of some 120 chars. This makes even simple xqueries like /tag[id=$longID] very slow if there are lots of /tag entries. What's worse: while the query is understandably slow if no text index exists, it becomes even slower (much slower!) if a text index is established. I suspect that is because BaseX optimizes the query for index use, but since the key cannot be in the index now *all* data has to be searched, not just the /tag elements.\r\n\r\nI attempted simply setting MAXLEN = 192 in the BaseX sources and did not experience any problems. Do you agree? In that case, it would be great if you could make this configurable.\r\n","number":305,"url":"https://api.github.com/repos/BaseXdb/basex/issues/305","comments":5,"assignee":null},"comment":{"user":{"id":1080242,"login":"malamut2","url":"https://api.github.com/users/malamut2","avatar_url":"https://secure.gravatar.com/avatar/6f4f987119e2cf2e4e0f9200f3d9f83a?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"6f4f987119e2cf2e4e0f9200f3d9f83a"},"created_at":"2011-12-20T21:18:56Z","updated_at":"2011-12-20T21:18:56Z","id":3225523,"body":"I haven't seen any problems with the new MAXLEN so far. Thanks again!","url":"https://api.github.com/repos/BaseXdb/basex/issues/comments/3225523"},"action":"created"}