Skip to content

Commit

Permalink
Big performance boost for faceting, closes #1394
Browse files Browse the repository at this point in the history
  • Loading branch information
simonw committed Jul 15, 2021
1 parent 5873276 commit 57c294e
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions datasette/views/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -674,12 +674,11 @@ async def data(
else:
page_size = self.ds.page_size

sql_no_limit = (
"select {select_all_columns} from {table_name} {where}{order_by}".format(
sql_no_order_no_limit = (
"select {select_all_columns} from {table_name} {where}".format(
select_all_columns=select_all_columns,
table_name=escape_sqlite(table),
where=where_clause,
order_by=order_by,
)
)
sql = "select {select_specified_columns} from {table_name} {where}{order_by} limit {page_size}{offset}".format(
Expand Down Expand Up @@ -736,7 +735,7 @@ async def data(
self.ds,
request,
database,
sql=sql_no_limit,
sql=sql_no_order_no_limit,
params=params,
table=table,
metadata=table_metadata,
Expand Down

0 comments on commit 57c294e

Please sign in to comment.