Production DBA
Fact-Checking Microsoft’s “PostgreSQL to SQL Field Notes: Connections”
Microsoft has started a series of blog posts helping Postgres developers who are “upgrading” to Microsoft SQL. (Microsoft’s been using that generic “SQL” term to refer to its collection of database products: Azure SQL DB, Hyperscale, Managed Instances, and SQL Server.)
I let the first blog post slide, but the second post explained why Microsoft is so much better than Postgres at handling connections, and it’s so egregiously misleading that I’m gonna have to step in.
The post claims that Microsoft “supports up to 32,767 simultaneous user connections per instance” – and that’s true, but only if those connections aren’t doing anything!
See, Microsoft SQL has a different problem than Postgres does. Microsoft SQL has a concept of “worker threads”, and it’s best explained by thinking about a take-a-number dispenser.
When you walk into a grocery store, and you go to the meat counter, you’ll likely see a take-a-number dispenser. You grab one of those numbers, and you wait for your turn to be called. When it’s your turn, you can go up to the butcher and get the stuff you need. (Vegetarians: I’m sure the same concept applies in the produce aisle, I’ve just … never been over there. If I lived in India, I’d be a vegetarian for sure, because y’all’s vegetarian food tastes AMAZING and I don’t feel like I’m sacrificing anything at all, but here in America, most vegetarian food tastes like shoe sandals. I wonder if American vegetarians all have foot fetishes? Moving on.)
Lots of people can be in the grocery store at once, as long as they don’t need to talk to the butcher.
Worker threads: where Microsoft’s claim starts to fall apart
Microsoft’s claim that they support 32,767 connections means yes, that many people can walk into the grocery store – but they can’t actually do anything. When they wanna run a query, they have to get a number from the take-a-number dispenser.
That’s called a “worker thread”, and it’s way, way more limited, as the docs explain:
- Servers up to 4 CPU cores: 512 worker threads, aka max 512 numbers in the take-a-number dispenser
- 5 to 64 cores: 512 + ((logical CPUs – 4) * 16), so for example an 8-core server gets 576 worker threads
- 65+ cores: 512 + ((logical CPUs – 4) * 32), so a 72-core server gets 2,688
That worker thread number dictates how many queries you can actually run, which is much, much more impactful than the number of connections – especially because of the second problem we have in Microsoft SQL, which is…
Parallelism: where Microsoft’s claim catches fire
Microsoft SQL automatically parallelizes parts of your query where it makes sense, and I love that feature. It’s awesome. It’s not perfect, and if you Google for CXPACKET you’ll find all kinds of database administrators struggling with Microsoft SQL’s inability to evenly parallelize work. It’s completely normal to see a query’s tasks getting “parallelized” across multiple cores, but all of the work ends up on a single core.
However, here’s the part you’re gonna care about: when a query goes parallel, it takes multiple numbers from the take-a-number dispenser. The default parallelism settings make this particularly problematic: in Azure SQL DB and related flavors, it’s 8, and in Microsoft SQL Server, it can be even higher than that.
Even worse, the query doesn’t just take 8 numbers at once: it takes 8, plus another one for a coordinating parallelism manager thread, for each simultaneous parallel branch in the query. The larger your query is, the more likely it is that SQL Server can break it up into branches that can execute simultaneously, and if those things can parallelize, buckle up:

In this particular demo query from my Mastering Server Tuning class – which explains why I have a “take a number” dispenser at my house, because, you know, I need props for my classes – running on a 4-core server, a query goes parallel across 50 branches, spawning 200 tasks, using up 250 worker threads:

So on my 4-core server, which only has 512 numbers in the take-a-number dispenser, this one query grabs 250 numbers from the take-a-number dispenser. If just two of these queries run simultaneously, I’m down to only 12 numbers left! Granted, this is an extreme case – it’s fairly unusual to see a single query with more than 2-3 simultaneous branches – but the same problem exists with those small queries, run simultaneously at scale.
But wait, it gets worse.
Blocking: where Microsoft’s claim has rapid unscheduled disassembly
Your query continues to hang on to those paper numbers the whole time it’s running. If your query happens to get blocked by another query – something that’s very frequent, given that most of Microsoft SQL’s products default to pessimistic concurrency, where readers can block writers and vice versa – then your query is sitting there doing nothing, while still hogging those numbers, preventing other queries from starting.
Can apps CONNECT to the database server? Maybe, and that’s what Microsoft is so apparently proud of, that giant 32,768 connections number. But who cares? If those apps try to actually connect to do anything, and they want a number from the take-a-number dispenser, they’re gonna find it empty.
Including diagnostic queries.
Including monitoring tools.
It’s a common nightmare scenario for database administrators, and if you Google for SQL Server THREADPOOL you’ll find a lot of confused admins saying, “I don’t understand what’s happening – my database server’s CPU is sitting at 0%, but when people try to connect or run queries, they get timeouts! My monitoring system just shows blanks when this is happening!” Yeah, because your monitoring apps also need to connect to the database server to run diagnostic queries, and they can’t do it either.
This week, Louis Tochon uncovered a wild related problem: if you use the new sp_invoke_external_rest_endpoint, it consumes an unlimited amount of worker threads. You end up with worker thread exhaustion, and people unable to connect to the server.
Summary: no, Microsoft SQL isn’t problem-free.
If you’re coming from Postgres, you’re used to reading unbiased blog posts and articles from people who are just trying to help you. You’re going to need to think more critically when you read blog posts that live on Microsoft.com itself, or on Microsoft’s YouTube channels, because they’re usually written by people who are being paid to convert you to Microsoft. These people are often really nice, and they mean well, and they believe in the product they’re selling you, but they are selling you a product. Make no mistake: you’re not reading educational material, you’re reading marketing material.
What’s the solution? Find independent community members who blog about how Microsoft SQL products work. Here are some of my favorites who are currently actively blogging:
- Blog & tools: Erik Darling
- Blog: SQLServerScience.com by Hannah Vernon
- Book: T-SQL Fundamentals by Itzik Ben-Gan – it’s old, but it’s great and relevant
- Book: SQL Server 2025 Tuning by Grant Fritchey
And of course, there’s, uh, me. I’ve published 3-4 blog posts and videos per week across the last couple of decades, I maintain the First Responder Kit repo, I do performance tuning consulting for companies as large as Google, Stack Overflow, and other companies you’ve heard of, and I teach unbiased training classes. I use both Postgres and Microsoft SQL every day.
I really do love the Microsoft data platform – I just don’t want you to think it’s all a bed of roses, because there’s a whole lot of thorns in here, and I can help you avoid those. And if you wanna attend my live classes, hey, take a number.
Free, 3× a week
Get my new posts by email
Three posts a week, plus a Monday roundup of the best database news from around the web.


I’m surprised that you think people are moving in that direction: from Postgres to MSSQL.
In Europe I hear a lot of thoughts about going in the opposite direction.
What makes you think I believe they are? I’m curious.
Yes, right.
I know you are focusing on PostgreSQL.
Well, by commenting on this post, and not just ignoring it?
But criticising the post works fine.
Thank you.
Heh, okay, cool. Yeah, I agree with you – I don’t think people are moving existing apps in the direction of Postgres to MSSQL.
I understand why Microsoft marketing would say, “We need to compete against Postgres, so let’s come up with ideas for how to convince people to switch.”
First, they would want to call it “Microsoft SQL” because they can’t just say Azure SQL DB – a lot of development happens in AWS & Google & on-prem & other cloud providers. They have to come up with a generic term to house all of their databases.
Then, they would want to call it “upgrading to Microsoft SQL” because the MS side can (but may not) cost more, plus they can’t just call it “migrating” because they need it to look like there are clear benefits to moving from Postgres to Microsoft SQL.
Then, they would need to publish blog posts that describe the “upgrade” benefits, and I can totally understand why they would call Postgres’ lack of built-in connection pooling a “drawback” of Postgres. In a sense, they’re right in that connection pooling is less of an issue in the early stages of apps built on the Microsoft SQL stack. It just pops up later with the worker thread thing.
So yeah, I agree – I don’t think people are moving, but Microsoft has to publish blogs worded like this if they WANT people to make the move. And of course they want people to do it, because Microsoft likes money just like everybody else. 😀
I should add – I definitely don’t think Postgres people are “upgrading” to Microsoft SQL en masse. So I wanted to ask you why you thought I did, because I wanted to make sure I wasn’t giving that impression.
I don’t think Microsoft SQL people are migrating existing apps to Postgres en masse either – it’s too hard in most cases – but I think a lot of peoples’ skills are making the migration because Postgres is where most new development happens.
Oh I love this. Someone finally (that I could find) has put out how SQL Server allocates those threads and we keep on getting the TCP/IP timeouts when it’s so busy. I really wish more monitoring apps would include worker threads since it totally explains why the server gets un responsive. Not only that, but it is the metric I use most often to tell the health of a server. Blocking… High worker threads. Latches… high worker threads. For years I’ve had to use sp_server_diagnostics to pull it lightly. Everytime our SREs ask why the server was unresponsive even though the CPU was low (which can happen with blocking) – worker threads.
You shouldn’t have let the first one slide. Timezone support in Sql Server is worse due to the non-standard timezone names.
The latest post in Azure SQL Dev Center is a warning about Canada’s upcoming DST rule changes that required new TZ names in Sql Server and Windows, and thus code and query changes.
https://devblogs.microsoft.com/azure-sql/canadas-2026-time-zone-updates-guidance-for-microsoft-sql/
I saw that. (sigh) It was tough though, I’ve already got a month-long backlog of queued blog posts, and it’s hard to push something out of the way. The connections post was just so egregious that I couldn’t let it slide
This is a pretty great article. You’re quite right that worker exhaustion is a real concern in SQL, and this article makes that very clear. But my article focused on differences in connection overhead, particularly for idle connections, rather than concurrent request execution. Crazy, but both our points are objectively true. But they’re mostly apples to oranges, honestly, not really at odds with each other. Easy enough mistake to make. I’m glad you took the time to explain worker exhaustion to interested readers. Thanks for the read, the feedback, and the passion. You’re an excellent writer and clearly know what you’re talking about when it comes to these engines. Cheers.
Thanks for the kind words, but I gotta be honest here: comparing idle connections is like saying, “Our car seats 14 people!” but not actually being able to put it in gear and drive unless only 4 people are in it.
We don’t buy cars to use as seats, and we don’t buy databases to let people connect and do nothing.
Is it “objectively true” that a car that seats 14 people at idle is better than a car that only seats 4, when both cars only move forward with 4 occupants? I’m … not convinced. But I get it – your job is to sell the 14-seater, and you gotta do what you gotta do. 😀
I like that analogy, BUT it assumes all 14 passengers need to drive the car simultaneously. 🙂 Why? Most applications have connections that alternate between idle and active states, much like threads in a multitasking operating system. Maintaining connections really does have a cost, even when they’re not executing requests, especially in PostgreSQL. That’s the architectural difference I’m really struggling to get across, not a claim that SQL Server can execute more concurrent queries.
Maybe this analogy works better: imagine your van can carry 14 passengers, but only four can be actively moving around at once because of limited aisle space. The other ten can remain seated without consuming that space. But in the PostgreSQL van, every passenger requires a dedicated driver and engine, even when they’re doing nothing! Both vans have limits, of course. I think your article clearly explains that no database is without resource constraints. But to finish the analogy, the cost of accommodating passengers is fundamentally different, and most likely lower in the first van: the SQL van.
Look, we agree that every database engine has resource constraints. Worker exhaustion is a legitimate concern, but it doesn’t erase the architectural advantage of lower connection overhead. Do you think it does? I can’t imagine you do. Frankly, I can’t tell if you think SQL Server’s differences are just marketing or something, but they’re real. SQL connections don’t require the same server resources as PostgreSQL connections. Honest. You can test this for yourself. How are we sideways on this?
To be transparent, my biggest takeaway is that I need to word things more carefully. If someone with your expertise comes away with such a vastly different understanding of what I was trying to say, then I clearly have room to improve. I’ll chew on this exchange. Please feel free to write fact-checking articles anytime. Nobody’s perfect. Cheers.
I feel like you’re touting an advantage nobody’s looking for – again, that “our van can handle more people, it just can’t take them somewhere at the same time – some of them have to get out before we get things done.”
I mentally bailed out here:
I’m not even close to agreeing, like not in the same hemisphere to where it even makes sense to have a conversation about that. If you truly believe Microsoft SQL Server is cheaper than Postgres, it’s not even worth us having the discussion.
Best of luck on it, though! I long for the day when that’s actually true. Cheers.
Fair enough. I can’t even figure out what facts you are checking at this point, to be honest. Feels like my article isn’t really the topic here. Anyway, I’m probably wrong about whatever it is. It sure wouldn’t be the first time; you can fact-check that with my wife!
My buddy just spent three grand on his dog’s knee surgery. Funny, but that made me think about PostgreSQL: free like a puppy! 😉 TCO is an elusive calculation, no question. I know you know.
Keep fighting the good fight & have a great week, Brent! Cheers.
Jerry, in the PG world this is a solved problem thanks to software like PgBouncer. You probably know this already. But it’s worth saying.
Postgres has lots of areas you can target that are actually deficient as compared with SQL Server. Why choose one where the problem is really not a very big deal? That’s what fueled Brent here. (Not speaking for Brent, just my read.) Tackle a real problem next time — for example, monitoring.
Bingo. Or backups, or AGs, or failover clustering, or parallelism, or online index builds…
32k is way bigger than 100. How many people will read past that stat before adding it to their slide deck and moving on?
Zero. No one is migrating in that direction. And anyone who knows PG knows that that quoted 100 is pure BS.
I was thinking that the entire time I read, but don’t have the industry knowledge to make your confident assertions.