Join Cardinality Preview

Predict inner, left and full equality-join row counts from key multiplicities and identify which keys cause many-to-many fanout.

Custom requests cost 0.04 USDC on Base.

Download example JSON · OpenAPI · Source and usage

Pay with a browser wallet · Open example in checkout

POST a JSON request to /join-cardinality-preview/v1/check with an x402 V2 client.

Worked example

Request

{
  "left": [
    {
      "key": "a",
      "rows": 3
    },
    {
      "key": "b",
      "rows": 1
    },
    {
      "key": null,
      "rows": 2
    }
  ],
  "right": [
    {
      "key": "a",
      "rows": 2
    },
    {
      "key": "c",
      "rows": 4
    },
    {
      "key": null,
      "rows": 1
    }
  ]
}

Result

{
  "inner_rows": "6",
  "left_rows": "9",
  "full_rows": "14",
  "unmatched_left_rows": "3",
  "unmatched_right_rows": "5",
  "many_to_many": [
    {
      "key": "a",
      "joined_rows": "6"
    }
  ]
}

Support catalog maintenance through GitHub Sponsors. Sponsor gptenv · Sponsor Jeremy Carter