News for hackers. Stuff that matters.
Re:Thinking Psycopg3 by yingw787 on Wednesday March 11, 2020 @07:15PM (#22551830)
Wait...are you saying 100,000 records is a lot? If so, I disagree. Any serious enterprise workload is millions, usually tens, hundreds of millions, and oftentimes billions or tens of billions or more over the lifetime of any given production UNIX process. Hundreds of thousands is dev testing range. I've dealt up to single-digit billions, and I can say having a cursor is absolutely a requirement when working with production data.
Re:Thinking Psycopg3 by paulddraper on Wednesday March 11, 2020 @09:11PM (#22552491)
Yes, I'm claiming that retrieving 100,000 records in a single query is a lot.

If thousands of records weren't a lot, HN wouldn't have to manually break up comment threads anytime a U.S. president is elected.

Re:Thinking Psycopg3 by stefan_ on Wednesday March 11, 2020 @07:31PM (#22551940)
For the database. If your application is retrieving millions of rows, you might want to reconsider what using a database with a complex query protocol is giving you and whether you are using it correctly.
Re:Thinking Psycopg3 by marcosdumay on Wednesday March 11, 2020 @08:40PM (#22552346)
If my application is retrieving millions of rows, it may be because I need to pass a window function over millions of rows. Or it may be that I need to copy millions of rows from one place to another. Or I may need to compare them with other millions of rows from another source somewhere else. Or I may need to transform those millions of rows on my application because I can scale it better than the database...

Just because you didn't think of some valid usage for a feature, it doesn't mean that there isn't any.

Re:Thinking Psycopg3 by tomnipotent on Wednesday March 11, 2020 @10:02PM (#22552850)
> it may be because I need to pass a window function over millions of rows

Every major RDBMS supports window functions (even MySQL, though recent). Why would you bring remote data into a local process to do something the remote process can do with its own local data vastly more efficiently?

Re:Thinking Psycopg3 by ben509 on Thursday March 12, 2020 @01:15AM (#22553993)
Probably related to why the database has millions and millions of rows in the first place. Maybe someone read about denormalization in "Super Webscale SQL!" and blew up a trivial database. Or they're hoovering up vast quantities of garbage data and running it through a BI tract to produce bullshit.

I worked at a company that bilked the government for vast sums of money by doing all this and charging them for the hardware. The guvvies knew what was going on, but their little empires were more important if they got a bigger budget, so they went along with it.

Re:Thinking Psycopg3 by marcosdumay on Thursday March 12, 2020 @06:23PM (#22562550)
Oh, God forgive if a company actually has a few million sales it must account for, or if a government body actually wants to control and verify what it does. No it's all because of stupid webscale! developers, because nobody ever does anything that isn't a web or finance startup! Ever!
Re:Thinking Psycopg3 by vosper on Wednesday March 11, 2020 @07:27PM (#22551909)
I don't really understand your point. You and the person you replied to are both agreeing that cursors are useful for large datasets. Whatever defines "large" isn't that interesting and is dependent on context: got a resource-constrained DB? Or very wide tables? Constraints on the client side for how much data it can consume and process? Then, maybe your "large" is a lot different to mine.
Re:Thinking Psycopg3 by ben509 on Thursday March 12, 2020 @01:01AM (#22553938)
> Whatever defines "large" isn't that interesting

Some people get excited about huge datasets; I don't get it myself, but "big data" is a successful buzzword because it pushes people's buttons.

Re:Thinking Psycopg3 by AlphaSite on Thursday March 12, 2020 @12:56AM (#22553919)
They are arguing it’s useful for smaller datasets as well.