Skip to content

duplicate index names #282

Description

@hokaxbt

Shovel version af07 introduces tableindex field, which enhances query performance.

However, there's a limitation in the current implementation where specifying only column names as parameters can cause silent index creation failures.

For example, when defining two tables with similar index configurations:

{
    "name": "eth_events_univ2_pair_created",
    "columns": [
        { "name": "block_num", "type": "numeric" },
        { "name": "transaction_hash", "type": "bytea" },
        // ... other columns
    ],
    "index": [
        ["block_num DESC"],
        ["transaction_hash"],
        // ... other indexes
    ]
}

{
    "name": "eth_events_univ2_mint",
    "columns": [
        { "name": "block_num", "type": "numeric" },
        { "name": "transaction_hash", "type": "bytea" },
        // ... other columns
    ],
    "index": [
        ["block_num DESC"],
        ["transaction_hash"],
        ["pair"]
    ]
}

Shovel attempts to create indexes with identical names (shovel_block_num and shovel_transaction_hash) across both tables, resulting in index creation failures in one of the table

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions