Home / Companies / Neon / Blog / Post Details
Content Deep Dive

When LIMIT 9 works but LIMIT 10 hangs

Blog post from Neon

Post Details
Company
Date Published
Author
George MacKerron
Word Count
1,971
Company Posts That Month
16
Language
English
Hacker News Points
289
Post removed?
No
Summary

The author, working with the serverless driver for PostgreSQL, encountered a problem with WebSockets support in Node 18 and above using undici, which was causing queries with an ORDER BY clause to hang or fail. The issue was resolved by adding byteLength and byteOffset arguments to the new DataView() call in the undici code, which fixed a bug related to how buffers are handled in Node's Buffer class. This fix worked because the buffer allocated for a WebSocket frame is often stored in a global pool of small buffers, which can lead to issues with writing data to the wrong location if not done correctly. The author also discovered that using writeUInt16BE() instead of creating a DataView() was faster and more readable than the original approach used by undici.

Trends Found in this Post
Trend Post Mentions Total Month Mentions Posts Companies MoM
Serverless 3 754 147 59 +46%
Use This Data

Use this post, company, and trend context to find content marketing opportunities, perform competitive analysis, or address product feature gaps via the Plushcap MCP server or the Plushcap API.