-
Notifications
You must be signed in to change notification settings - Fork 17
fix: re-enable subgraph_domain.name indexes (hash + gin trigram) #1856
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
Changes from 2 commits
7c58b7f
5aa8208
2006086
56e1c7e
a15e021
127c1de
a62a62a
427ff54
3d49f4f
e5f770b
6168351
fef01b5
072fff2
dec0101
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| --- | ||
| "ensindexer": minor | ||
| "@ensnode/ensdb-sdk": minor | ||
| --- | ||
|
|
||
| Re-enable `subgraph_domain.name` indexes (originally disabled in #1819) by pairing a hash index for exact-match lookups with a GIN trigram index (`gin_trgm_ops`) for partial-match filters (`_contains`, `_starts_with`, `_ends_with`). The hash index avoids the btree 8191-byte row size limit triggered by spam names. The trigram index requires the `pg_trgm` Postgres extension, which ENSIndexer now installs automatically in the setup hook before Ponder creates indexes. | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -93,9 +93,13 @@ export const subgraph_domain = onchainTable( | |
| expiryDate: t.bigint(), | ||
| }), | ||
| (t) => ({ | ||
| // Temporarily disable the `byName` index to avoid index creation issues. | ||
| // For more details, see: https://github.com/namehash/ensnode/issues/1819 | ||
| // byName: index().on(t.name), | ||
| // uses a hash index because some name values exceed the btree max row size (8191 bytes) | ||
|
shrugs marked this conversation as resolved.
shrugs marked this conversation as resolved.
|
||
| byExactName: index().using("hash", t.name), | ||
|
shrugs marked this conversation as resolved.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm surprised no other code is updated in relation to us making the schema changes here? Ex: code in API handlers?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. none! postgres planner will use the indexes without specification |
||
| // GIN trigram index for partial-match filters (_contains, _starts_with, _ends_with). | ||
| // Requires the `pg_trgm` extension, installed by the ENSIndexer setup hook | ||
| // (see `initializeIndexingSetup` in `apps/ensindexer/src/lib/indexing-engines/ponder.ts`). | ||
| byFuzzyName: index().using("gin", t.name.op("gin_trgm_ops")), | ||
|
shrugs marked this conversation as resolved.
Outdated
|
||
|
|
||
| byLabelhash: index().on(t.labelhash), | ||
| byParentId: index().on(t.parentId), | ||
| byOwnerId: index().on(t.ownerId), | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.