3 ms·
You can use SQL92 as a query language (this is how people usually use ODBC with kdb), simply write "s)" in front: s)SELECT a, b, SUM(c), SUM(d), AVG(e) FRO
by geocar 9y ago
You can use SQL92 as a query language (this is how people usually use ODBC with kdb), simply write "s)" in front:
s)SELECT a, b, SUM(c), SUM(d), AVG(e) FROM table WHERE f > 69 GROUP BY a, b
but q is much easier:
select sum c, sum d, avg e by a, b from table where f > 69
Having used both q/kdb and other databases, I prefer q/kdb.
Things I often hate about writing in SQL:
- Those unnecessary GROUP BY statements
- Too much set theory: ORDER BY
- Not enough join operators. asof queries are very difficult to write.
- Difficult to be performant
Things I generally hate about SQL servers:
- Very difficult to use cores strategically (in q I just run taskset+q on e.g. a cron job; in Pg setup is much harder requiring multiple data directories)
- Very difficult to keep things in ram (tablespace + unlogged)
- Very difficult to implement incremental async builds (triggers + replication is the best I've figured out in Pg; in q I just use IPC and let the kernel queue)
- Switching to algorithms to make a new function is ugly and almost a different language (PL/PSQL in the best cases is a horrible language, and C is not so bad but sometimes requires root).