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

One optimization is to write big O notation in minimized form. It looks more impressive to write O(n).

And to try being helpful: do aggregation in the db where possible, be sure indexes are good, play around with the number of rows you process at a time, use joins if appropriate to minimize queries, if your queries are expensive at all use EXPLAIN, depending on the database, look into using a cursor (maybe?).



Cursor?

I was using LIMIT and OFFSET, did you mean something else?

update: I processes 200k-300k rows in a few hours, and since the DB is on the same box, as the php app, there is no need to make this more complicated.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

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

Search: