7,244 karma · joined Sep 25, 2010 (16y ago) · 2,593 submissions
comment 13y ago · link · parent
* 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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
A number of people disagree with that conclusion based on seemingly reasonable scientific arguments.
comment 13y ago · link · parent
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
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
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
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.