Better HN
topnewbestaskshowjobs
Log inSign up

wojcikstefan

341 karma · joined Jun 29, 2012 (14y ago) · 107 submissions

Software Engineer at Close (YC W11).

https://twitter.com/wojcikstefan https://github.com/wojcikstefan

Submissions

comment 2y ago · link · parent

> A diet of mostly-plants can be just as delicious as one with a lot of beef.

I strongly disagree – as a person who's eaten vegan for over a year, tried all the fancy meat alternatives, and has gone back because a good grass-fed steak is just 10x more delicious.

comment 2y ago · link · parent

Thank you very much! :) I still advise that you try really, really hard to avoid using `pg_hint_plan` if you can, but it's nice that it exists if all else fails or if you need temporary relief at a time of crisis.

comment 2y ago · link · parent

Good intuition and thank you! :) Not sure if this is a good fit for you, but you could consider using the partitioning built into Postgres to split one large logical table with all your games into a "hot" partition containing the currently running games and a "cold" partition containing your finished games.

https://www.postgresql.org/docs/current/ddl-partitioning.htm...

comment 2y ago · link · parent

Agreed, event sourcing is a pretty good match for call flows. You could first store every call leg / conference / recording / etc. webhook Twilio sends you as an event and then derive the state of the final "call" concept from those pieces of data.

comment 2y ago · link · parent

Hi HN community, author of the post here. Let me know please if you have any questions, comments, or feedback!

6.

PostgreSQL Statistics, Indexes, and Pareto Data Distributions(making.close.com ↗)

49 points · by wojcikstefan · 2y ago · 8 comments

comment 2y ago · link · parent

Can you tell us more about your scaling issues with Temporal?

I haven't yet used it in production, but I would've expected that a system which evolved out of Uber's Cadence [0] (and which I believe is used at Uber extensively) would've scaled very well.

[0]: https://stackoverflow.com/a/61281435/1579058

comment 3y ago · link · parent

Hiya Aidan! :D

> Is this behaviour new?

Don't think so. Even the docs for SQLA v1.3 ([0]) mention it:

> native_enum – Use the database’s native ENUM type when available. Defaults to True. When False, uses VARCHAR + check constraint for all backends. The VARCHAR length can be controlled with Enum.length

[0]: https://docs.sqlalchemy.org/en/13/core/type_basics.html#sqla...

--

> Or is it that alembic still doesn't pick up changes to the enum to recreate the constraint?

Off the top of my head, I believe Alembic doesn't pick it up automatically. We make a lot of manual tweaks to our auto-generated Alembic migrations and I believe adding / modifying the CHECK constrains is part of it.

comment 3y ago · link · parent

Whew, good to know! Another point towards the `CHECK` constraint approach. Thanks! :)

comment 3y ago · link · parent

Can you elaborate on what it means to use PostgreSQL enums "on your code API"?

> It's such an outrageously naive idea that I'm sure most people here were attracted to the title thinking it's about algebraic types or some other similar misunderstanding.

Just to share how we at Close got into this discussion (which I personally don't find as "outrageous" as you), SQLAlchemy – which we use in our Python code – uses `native_enum=True` as the default value for its `Enum` type [0], which then translates to using types in PostgreSQL:

> native_enum – Use the database’s native ENUM type when available. Defaults to True. When False, uses VARCHAR + check constraint for all backends.

[0]: https://docs.sqlalchemy.org/en/20/core/type_basics.html#sqla...

comment 3y ago · link · parent

> I usually use C# Enums translated by EF Core now (...)

Does this approach ensure data consistency? Or could you accidentally insert a number value into your table which is not represented by any of the enum values?

comment 3y ago · link · parent

Apologies for my ignorance, but what does "FDW" stand for in your comment? :)

comment 3y ago · link · parent

Just to make sure I understand your suggestion fully, you're saying: 1. Use `smallint` instead of `text` for the column type. 2. Otherwise follow our "`CHECK` constraint" approach (without it we're jeopardizing data consistency because we can store anything between -32768 and 32767 in that column). 3. Translate the int to the enum in your application.

Right?

14.

Representing Enums in PostgreSQL(making.close.com ↗)

112 points · by wojcikstefan · 3y ago · 74 comments

comment 3y ago · link · parent

Coca Cola & Red Bull are massive, they surely have tiny marketing spend… Right?

comment 3y ago · link · parent

Agreed!

comment 3y ago · link · parent

I thought it was GitLab which was remote-first (or should we say remote-only?). GitHub still seems to have offices and people going into them.

comment 3y ago · link · parent

My heart goes out to the laid off employees, though I think they'll be able to find solid jobs (or start their own companies) when they're ready.

What I'm more surprised by is: 1. GitHub operating so independently from Microsoft at large that they have their own layoffs (not included in the 10k people that Microsoft announced they'll be parting ways with). 2. GitHub operating SO INDEPENDENTLY that they can decide to go remote-first.

comment 3y ago · link · parent

The YC company I work at (and have been happy working at for the last 11 years) is hiring remotely, anywhere in the time zones of Americas, Europe, and Africa: https://jobs.close.com

20.

How to connect to PostgreSQL (and other data stores) reliably(making.close.com ↗)

6 points · by wojcikstefan · 4y ago · discuss

comment 4y ago · link · parent

I wholeheartedly agree with every single word in this post. I also mourn this feature's death daily. Being able to force-push on the spacebar is not good enough of a replacement.

comment 4y ago · link · parent

Back when I lived in San Francisco I've met many people who used the SF311 app [0] where you can very quickly snap a picture and report an issue. One person I knew did so multiple times a day every day for many things – poop, trash, etc. The impressive thing was that the authorities would indeed show up often and clean things up.

[0]: https://apps.apple.com/us/app/sf311/id666635420

comment 4y ago · link · parent

I live in Poland and regularly order Uber Eats/Wolt for $6-8.

comment 4y ago · link · parent

1. This is not “no-code”. You still have to read & understand the code Copilot generates.

2. I’m very skeptical of a small group of people reading a bunch of online comments and deciding what is “toxic” and “non-toxic”, even more so when it’s done with no clear definitions/guidelines. As their GitHub repo [0] says:

> Rather than operating under a strict definition of toxicity, we asked our team to identify comments that they personally found toxic.

[0]: https://github.com/surge-ai/toxicity

comment 4y ago · link · parent

I'm very happy about this proposal. The only sad thing is that it has come so late, after so many tools and protocols (e.g. GraphQL) already abuse POSTs for this use case.

comment 4y ago · link · parent

> Maybe have a X-GET-QUERY header to indicate the type if GET request?

Note that using the "X-" prefix has been deprecated since 2012: https://datatracker.ietf.org/doc/html/rfc6648

comment 4y ago · link · parent

IMO this helps a lot more people than just database folks. Any web application which implements a fairly granular search/filtering mechanism for its resources may run into the URL character limit with GETs. QUERY sounds much more appropriate here than what most applications do today (i.e. abuse POSTs).

comment 5y ago · link · parent

Ah, yep, that explains it.

They do solve this problem as documented: https://github.com/socketio/engine.io/blob/64d57545116c7a7d9...

comment 5y ago · link · parent

100% agree!

comment 5y ago · link · parent

Indeed it does! https://github.com/primus/primus/blob/a7ba7249cb0205a01629da...

I do wish we didn't all have to reinvent this wheel though…

1234