Skip to content

JoinOrder Q11c — Canonical JoinOrder 11c

JoinOrder benchmark · all JoinOrder queries

Canonical JoinOrder SQL query 11c; generated DataFrame translation

Representative SQL

Rendered for DataFusion with default parameters.

SELECT
MIN(cn.name) AS from_company,
MIN(mc.note) AS production_note,
MIN(t.title) AS movie_based_on_book
FROM company_name AS cn, company_type AS ct, keyword AS k, link_type AS lt, movie_companies AS mc, movie_keyword AS mk, movie_link AS ml, title AS t
WHERE
cn.country_code <> '[pl]'
AND (
cn.name LIKE '20th Century Fox%' OR cn.name LIKE 'Twentieth Century Fox%'
)
AND ct.kind <> 'production companies'
AND ct.kind IS NOT NULL
AND k.keyword IN ('sequel', 'revenge', 'based-on-novel')
AND mc.note IS NOT NULL
AND t.production_year > 1950
AND lt.id = ml.link_type_id
AND ml.movie_id = t.id
AND t.id = mk.movie_id
AND mk.keyword_id = k.id
AND t.id = mc.movie_id
AND mc.company_type_id = ct.id
AND mc.company_id = cn.id
AND ml.movie_id = mk.movie_id
AND ml.movie_id = mc.movie_id
AND mk.movie_id = mc.movie_id

Representative DataFrame

Expression family (Polars, PySpark, DataFusion), default parameters.

def _impl(ctx: DataFrameContext) -> Any:
return _execute_joinorder_expression_query(ctx, query_id)

Get the exact query for your run

The blocks above are representative. To get the precise statement a specific platform runs at a specific scale, substitute your own values:

from benchbox import JoinOrder
bench = JoinOrder(scale_factor=1.0) # your scale factor
queries = bench.get_queries(dialect="datafusion") # your platform's dialect; drop dialect= for native SQL
print(queries['11c'])

For the DataFrame form:

from benchbox.core.query_catalog import get_dataframe_render
print(get_dataframe_render('joinorder', '11c', family="expression").source) # or family="pandas"

Source

Query text: benchbox/core/joinorder/queries.py