FedericoRazzoli

Joined 6 years ago

Karma
245
Submissions
29
Member since
Nov 2
Director and Database Consultant at Vettabase Ltd (vettabase.com).

Free software supporter.

View on Hacker News

Recent submissions

Comment · 4 years ago
I wrote some hints on how to optimise #SQL queries containing LIKE. More ideas, including unconventional ones, are very welcome - just comment here or on the website.
Comment · 4 years ago
This is a great explanation! I wonder many times why we had to play with obscure xargs instead of being able to pipe a command output to an argument.
Comment · 4 years ago
The problem, though, is that SQL standard treats NULL as unknown or as missing. One word for two meanings.

For example, AVG(col) and COUNT(col) treat it as a missing value (NULLs do not alter the average or the count), but 1 + NULL treats it as an unknown value (the result is unknown). The complete list of NULL-related inconsistencies would be long.

It would have been better to use different words for different semantics, or not implementing NULL at all. Also, in some cases it can lead to poor query performance.

Comment · 4 years ago
You are right, though (some?) DBMSs allow to use HAVING for columns that appear in the GROUP BY clause.
Comment · 4 years ago
You are correct, HAVING is essentially syntax sugar. But to be fair, I'm glad it exists.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton