Better HN
topnewbestaskshowjobs
Log inSign up

wireprotocol

7,244 karma · joined Sep 25, 2010 (16y ago) · 2,593 submissions

Submissions

comment 13y ago · link · parent

There are a lot of conceptual differences, but I'll give a couple very important examples:

* With FDWs, you can push down predicates to the remote end. So, if you do: "SELECT * FROM myRemoteTable WHERE id = 2345", then it can just use the index on the remote side rather than pulling all the data to the local side and filtering.

* You can (as of 9.3) insert, update, and delete on the local side and it will pass through to the remote side.

comment 13y ago · link · parent

"Exclusion constraints would be pretty hard to implement in a distributed system."

It would be cool, though ;-)

"constraint exclusion wouldn't be all that rough, would it"

There are two interpretations of that:

* Passing a predicate down to the remote side so that the remote server can use it to exclude partitions. I believe this already works.

* Using CHECK constraints on the local side so that foreign tables can be excluded on the local side. This is a little trickier because it's hard to know that there are really no tuples on the remote side that violate the constraint. It's debatable how important that is, but it does need to be handled sanely somehow if the situation arises.

comment 13y ago · link · parent

Even if you manually write the query plan, you are still subject to similar disasters. That's because your data is changing, which can cause the query performance to fall off a cliff without changing the plan.

comment 13y ago · link · parent

Do you have an idea how that might be done?

comment 13y ago · link · parent

Teaching a student chemistry depresses the wages of all chemists, distorts the market, and damages all science. It is just pandering to big business interests.

Sarcasm aside, just because it's good for business doesn't mean that it's bad for you.

comment 13y ago · link · parent

Databases almost always grow outside of their original scope, much more so than applications. And there is a good reason: data is more valuable when it's combined with other data.

So I think it's reasonable to be cautious about using a system that can't effectively grow outside of its initial special purpose.

comment 13y ago · link · parent

"on-disk bitmap indexes ... thinking about volunteering to add them myself"

That would be reasonable to do even if you don't know the internals very well. The index types (called "index access methods") are well-isolated (API-wise) from most of the rest of the code. Technically, you could even add a new index access method as an extension without even touching the core.

The exception to both of those things is the WAL recovery code, which can't be written as an extension and also requires more knowledge of the rest of the system.

But the WAL recovery code is not too bad for those that know it. So if you did the rest, then I wouldn't be surprised if someone jumped in to write it or help you write it.

"A minor feature I'd like to see is to allow ORDER BY on UPDATE statements to avoid deadlocks."

One solution here is to do a "SELECT ... FOR UPDATE" first. Unfortunately, that is redundant (and does redundant work).

comment 13y ago · link · parent

"check all constraints and report all failures"

Interesting point. Foreign key failures are usually the result of a program bug. Unique and exclusion[1] constraints depend on concurrent actions, and can't be caught ahead of time as easily. So I assume you are mostly talking about CHECK constraints.

Also, we're talking about a single statement, which probably means a single table.

It does sound like a good idea to validate all of the check constraints on a table at once, and report all of the failures.

[1] http://www.postgresql.org/docs/current/static/ddl-constraint...

comment 13y ago · link · parent

Have you looked at the SE-Postgres work? Probably not exactly what you need, but there might be something there.

http://www.postgresql.org/docs/devel/static/sepgsql.html

comment 13y ago · link · parent

What system do you currently use? Which databases got this right for your use cases, and which ones got it wrong and why?

There's active development on this feature, so now's the time to influence it to better suit your needs. A separate blog post might be a better forum.

comment 13y ago · link · parent

"I wonder if it would be possible to plug a python/node interpreter into that."

Sure, why not?

This is a great feature because it is a significant extensibility improvement. And that's what postgres is really about: the idea that any user/developer with an idea has many powerful APIs that can help them achieve that without waiting for anyone else to agree that the idea is good.

comment 13y ago · link · parent

Another intepretation of zapov's comment is that it's a shame the NoSQL projects didn't try achieving their goals by building postgres extensions (or even adding new features).

A reasonable question. MongoDB could have focused their energies on really good JSON support in postgres and making postgres sharding easier.

comment 13y ago · link · parent

So, what's still missing in postgres?

To make the responses as constructive as possible, please also specify:

* Whether you currently use postgres, and what other systems you use (presumably ones that do have the feature that is missing in postgres)

* Whether you currently need the feature, or whether you anticipate the need in the future, or whether you expect that other people will need it

* Whether the missing feature is preventing you from using postgres, or just a significant pain point (which could include ease-of-use issues)

comment 13y ago · link · parent

I'm not saying that you shouldn't make short-term compromises. I'm saying that "right tool for the job" is sloppy reasoning.

Even in the short term, it might be much faster to develop against a good RDBMS than a nosql system. I think many developers are so focused on "abstracting away the data store" that they forget what a good RDBMS can do for them.

comment 13y ago · link · parent

That's ideal, but many kinds of updates require some kind of read.

I agree in general though.

comment 13y ago · link · parent

When installing a database system, it is rarely a "task". It's usually something that will live a long time and there will be many long-term consequences.

comment 13y ago · link · parent

"[EBS is] fine as a basic file store but should never be used for databases."

Doesn't Heroku use EBS for all of their postgres databases?

It may be the case that postgres works better on EBS than mongo does. Postgres has a traditional write-ahead log that minimizes (and spreads out) block writes and hides latencies. Mongo does not.

comment 13y ago · link · parent

"NoSQL is about the right tool for the job."

I never liked that rationale:

* The job almost certainly will change. Data lives a long time, usually much longer than the original application.

* It's likely to conflate marketing claims with actual fitness for a purpose. A special-purpose system with special-purpose marketing may sound great if the special case lines up with what you're doing. But that doesn't mean that it's actually a better fit for that special purpose. And, thanks to confirmation bias, people almost always think their situation does sound like the special purpose for which the system was built.

* A database system is a system, not a tool. A tool is used in a particular instance for a short period of time, the results are obvious, and it's easy to switch tools if one is not working out.

Of course, there are always valid reasons to choose the special-purpose system, and I'm not saying you shouldn't have used Couchbase. I just don't like the "right tool for the job" argument.

comment 13y ago · link · parent

Below certain numbers, it might be relatively harder to reduce some crimes than others. For instance, there might always be people who are determined to kill their spouse; but it might be easier to reduce the number of people who see stealing things as useful.

I don't really know, but it would be interesting to see some numbers. Is there some kind of minimum murder rate that can't be lowered further just with laws (i.e. some more fundamental cultural change is required)?

If so, then we might be approaching that minimum (for the current US culture/society) and that could explain why they aren't decreasing much any more.

comment 13y ago · link · parent

I don't see a rational weighing of costs and benefits here.

In particular, you should examine the risk of other activities that you consider acceptable for children, like swimming or going on a car trip to visit relatives in another state.

And you should also consider how many lives would reasonably be saved by your law, which might not work out as perfectly as you think.

comment 13y ago · link · parent

"I think you'll find most irresponsible drinkers started before 21 anyway."

Drinking illegally at 18 years old might lead to different outcomes than drinking legally at the same age.

comment 13y ago · link · parent

There's a graph of "non-fatal violent firearm crime" right in the article. It looks flat to me between 2001 and 2011.

Are both true somehow? Those facts seem to be in conflict.

comment 13y ago · link · parent

If you try to talk about violence, people are going to ask whether it is higher or lower than before. The fact that it is lower eliminates fear and sensationalism and the conversation dries up to little more than local police budget issues.

But if you talk about gun violence, people will generally have an opinion regardless of the facts, and won't tend to ask questions. That's why everyone has a strong opinion but few know that it's actually a declining problem.

comment 13y ago · link · parent

http://en.wikipedia.org/wiki/The_Impact_of_Legalized_Abortio...

A number of people disagree with that conclusion based on seemingly reasonable scientific arguments.

comment 13y ago · link · parent

That's interesting, because someone else pointed out a large increase in the total number of guns. Can you provide a link for that figure?

comment 13y ago · link · parent

A few years ago, it was hard to imagine that there would be a breakout compiler that would get developers excited.

It goes to show the value in competition and a fresh perspective. Error messages, modularity, and licensing could unseat GCC, which is pretty amazing.

(I know GCC still has many advantages, but clang/llvm clearly have made a lot of progress.)

comment 13y ago · link · parent

I think you are setting the bar too high. Nothing is perfect, but Wikipedia is great.

If you have some better idea how these things should be handled, then please explain.

comment 13y ago · link · parent

A Porsche is not what I'd call a practical car. It's not especially comfortable if you're tall, the visibility is poor, it doesn't hold a family or have much storage space at all, it's not efficient to operate or maintain, and it's not cheap to produce.

So what's the real lesson here?

Maybe it's something about aesthetics, but then the part about designing for expert drivers versus "average" drivers doesn't make sense.

comment 13y ago · link · parent

I wonder what effect online education will have on the diversity of thought?

Before, I was mostly thinking that online education is good for things with well-established and fairly uniform curricula (e.g. many math, science, and engineering courses). But it really struck me that the class in question was called "Justice". To think that we'd just have a few notable professors writing the curriculum for such a broad and subjective course is disturbing.

comment 13y ago · link · parent

I wasn't justifying anything. The person to whom I replied ignored a few obvious and valid arguments, and I was filling that void.

Even if prison was entirely intended for corrections, it is punishment (a denial of freedom). So there is a fairness argument that if two people do reasonably similar crimes that they should get comparable sentences. That is just one argument though, and fairness (as always) is weighed against other arguments.

1
707172
87