Skip to content

Commit

Permalink
Fix huge performance bug in DateFacet, refs #2407
Browse files Browse the repository at this point in the history
  • Loading branch information
simonw committed Aug 21, 2024
1 parent f28ff8e commit bc46066
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions datasette/facets.py
Original file line number Diff line number Diff line change
Expand Up @@ -480,8 +480,8 @@ async def suggest(self):
# Does this column contain any dates in the first 100 rows?
suggested_facet_sql = """
select date({column}) from (
{sql}
) where {column} glob "????-??-*" limit 100;
select * from ({sql}) limit 100
) where {column} glob "????-??-*"
""".format(
column=escape_sqlite(column), sql=self.sql
)
Expand Down

0 comments on commit bc46066

Please sign in to comment.