Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I'm always a little baffled as to why people just don't dump the data into a database, and then use SQL for further data manipulation and analysis.

I recently moved some data processing from Python/pandas into a database, and with SQL, the processing time went from several minutes to a couple seconds, (and that on a tiny VM).

I understand that not everyone is familiar with databases and SQL, and so default to the toolset they know. But, the performance gains can make learning databases and SQL highly worthwhile. (And, much can be learned in a just few days, especially for those already familiar with working with data.)



SQL is a total pain for many types of data. Eg time-series analysis is horrible and large datasets are almost impossible to fetch to the application due to the hilariously inefficient serialization formats.


If large datasets are impossible to fetch from a SQL database, even more impossible is to load them to memory.

From my point of view, the SQL database can store the huge dataset, with its changes, and I can iterate through the results, and make lots of nice queries getting only the data I need.


This depends largely on the use case. For example PostgreSQL insists of transferring all data using ASCII encoding, so eg. high sampling rate floating point sensor readings are extremely slow to fetch from the database.

And not all operations can be done incrementally by iterating through the results.


> This depends largely on the use case. For example PostgreSQL insists of transferring all data using ASCII encoding, so eg. high sampling rate floating point sensor readings are extremely slow to fetch from the database.

It doesn't. There's a binary version of the protocol. The output conversion for that is near trivial (transformation to big endian).


I stand corrected. The problem was due to Python drivers at the time not supporting it. Now there appears to be asyncpg.


Yea, the driver situation around the binary protocol isn't ideal :(. A bunch of the newer drivers have it, but a lot of the old stuff doesn't. Especially things like transferring some columns in binary, others not, isn't supported enough - even though it's pretty crucial.


hmmm...that's not been my experience, but YMMV.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: