Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
mutatio
on Aug 6, 2018
|
parent
|
context
|
favorite
| on:
How I slashed a SQL query's runtime with two Unix ...
The query includes `date_format(created_at, '%x%v1') as week_commit` - meaning it would need to be computed for every row.
mnw21cam
on Aug 6, 2018
|
next
[–]
That's only in the SELECT statement, which only needs to be performed after the join has been done.
qoi2ijds0
on Aug 6, 2018
|
prev
[–]
Only for every returned row. The projection does not affect the underlying result set, it merely "shapes" the results you have received. WHERE clauses are always run before SELECT
VintageCool
on Aug 6, 2018
|
parent
[–]
The query in the article has no WHERE clause. It must calculate that function for every row in `commits`.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: