7,244 karma · joined Sep 25, 2010 (16y ago) · 2,593 submissions
comment 13y ago · link · parent
If it were only for corrections, then it would cause all kinds of problems. The most obvious one is that you get one "free crime" to commit.
There's also a fairness (and rule-of-law) argument: if two people steal $100 each, why would one person be let out earlier?
comment 13y ago · link · parent
It allows normal btree indexing of, for example, the values for some given key by using functional and/or partial indexes.
It also allows indexing of "contains", "contains key", "contains all of these keys" and "contains some of these keys" by using GiST and GIN indexes.
comment 13y ago · link · parent
If you can use a more general-purpose system like Postgres and get everything you need, then that's better than relying on special-purpose NoSQL systesm. The better question to ask is: why use a NoSQL system when Postgres works just fine and is useful in more situations?
The history of databases is a history of absorbing special-purpose systems into general-purpose SQL systems. XML databases were once a major topic (albeit misguided); now it's just a feature. Same with Columnar storage, or OO databases, or geospatial (postgres is a leader in geospatial, as well).
Because data integration is so incredibly valuable, it pushes strongly toward general-purpose systems and people dislike one-off special-purpose databases unless they deliver a huge amount of additional value.
comment 13y ago · link · parent
In reality, the code itself is somewhat of a liability -- a source of bugs and a time sink when you try to make modifications. What you really want is the end product and the flexibility to modify and improve it. To have the end product you don't need the source at all, and to modify and improve it the source is (nearly) necessary but not sufficient.
That has a few implications. One is that companies don't want to be burdened with source code. They would prefer to share the burden with other users, as long as they aren't giving away any competitive advantage they have. Win-win: they keep the ability to improve and modify it as they need, but unload much of the maintenance cost.
The GPL avoids a problem where people take an open source project and try to drive it away with a closed-source product that is a little better. But that doesn't really happen as far as I can see -- usually, releasing a closed-source product based on an open source project is good for both.
comment 13y ago · link · parent
comment 13y ago · link · parent
Developers are relying more and more on database systems to solve their scalability needs.
If you didn't have a database, you'd need to make sure to get the locking right even when doing completely different queries. A SQL database solves that problem by doing the concurrency control for you (possibly with locks, possibly not). That's what allows a developer to quickly and easily make a reasonably complex application that scales to many concurrent queries.
(Sure, it sounds easy to add in a couple locks, or use STM. But then you need to make all of that work efficiently and also enforce unique constraints or something, and it starts to get a little more complex. Pretty soon you'll want secondary indexes, and a buffer pool, and checkpoints, etc.)
Postgres even added in an efficient version of True Serializability[1], which eliminates SQL race conditions.
So, can this all be extended to help with parallel execution of a single query? Yes. Some systems have had parallel query for a while, and cluster systems are also a different form of parallelism.
[1] http://www.postgresql.org/docs/9.2/static/transaction-iso.ht...
comment 13y ago · link · parent
Also, there are no specific plans for doing parallel query execution (that is, parallelizing a single query) in a major way any time soon. And parallel query execution can mean many things and take many forms.
Postgres is already good at parallel execution of many different queries.
comment 13y ago · link · parent
In particular, it doesn't just optimize your algorithm, it chooses better algorithms for you.
It does this by collecting statistics about the data (and keeping them up to date), and using those statistics to estimate the inputs to each operator in a candidate plan (a combination of algorithms that answers the query), and then estimate costs, and choose the candidate plan with the lowest cost.
(The above explanation is simplified and not entirely accurate. It discards most candidate plans before they even really become a plan. And "candidate plan" is not really the right terminology, but I thought it was more descriptive at a high level.)
comment 13y ago · link · parent
First of all, spending a lot of money only helps solve an aggregate demand problem. It's not clear that it is (or at least not entirely an aggregate demand problem). Economies can have many problems, some deep, some subtle, some ephemeral. Some problems are plausibly solved through spending, and some are not. Sometimes, people talk about economics as though they could apply Keynesian principles in Somalia and it would be a thriving economy in 5 years. It's not that simple.
Second of all, 1-2% interest sounds great, and like a good opportunity to do some infrastructure projects. However, we have to consider that the debt is not stable now. Given a trillion dollar deficit, that 1-2% money is going to be borrowed anyway. We don't necessarily want to borrow it now, because it could make it more expensive to borrow the money in the future that we already know we need to borrow.
Third, people don't necessarily trust economists. Economies are complex, and a bunch of smart people saying they have the answers is not convincing to many people. On its face, a statement like "borrowing and spending and consuming are good for the economy" sounds like something for nothing, and triggers skepticism more so than "saving and investing is good for the economy". Even if the principles are sound, people don't trust the implementation, which is sure to be twisted for political gain. A trillion dollars being spent brings people out of the woodwork to manipulate it to their advantage, perhaps sacrificing the country in the process.
Last, many people see that a lot of borrowing, spending, and consuming have been happening over the last decade or so; and we still have problems. It's only natural that people are considering a change of direction that involves less borrowing and spending and consuming.
comment 13y ago · link · parent
It's still basically a batteries-included distribution, but it is very extensible and getting more so. I expect to see many more domain-specific extensions (you can already see a lot at http://pgxn.org ).
However, I will say that it should be a simple core but not too simplistic. Especially for something like a database, some things are better done in the core (perhaps not inherently, but it's in research-project territory). That's really the challenge: it's not "pro-modularity" versus "anti-modularity"; it's about what constitutes a good base from which to build.
comment 13y ago · link · parent
Did you actually run into a practical problem here, or is this theoretical? Most people get along fine for a while, and when they have a problem, they use pgbouncer, which seems to solve it.
"extremely painful replication, largely offloaded to third party tools"
Do you have some more specific/constructive criticism here? A lot of work has gone into postgres replication over the past few years, and it's improved dramatically for some use cases. But there are many use cases for replication, so it's possible that you didn't see improvements for your use cases.
FWIW, I started out with MySQL, and then tried out Postgres because of the license (MySQL was not yet GPL). After MySQL was GPLed, I used both for a while, but found the postgres community more welcoming/informative, and found postgres much more pleasant to use. At one point around 2003 I basically threw mysql away completely because I was fed up trying to do simple date manipulation to make simple reports. Postgres made it so easy and it seemed so natural -- it's really hard to use mysql afterward without getting frustrated. I'm sure there are things like that in reverse as well; e.g. mysql has the ON DUPLICATE KEY clause, but to me it still didn't add up to a pleasant/productive experience.
comment 13y ago · link · parent
I don't think anyone sees it as the proper order of things. For one thing, only central planners even think in those terms. For another, there is no obvious policy that will have a better overall result in a large country like the US -- remember, every policy has unintended consequences and doesn't always turn out like you plan.
comment 13y ago · link · parent
"In politics, the spectrum of belief is right on the surface: conservative/liberal, right/left. In tech, that same spectrum exists, but it’s rarely discussed."
He may have the OED definition in mind more than the political one, but that's irrelevant. As soon as you invoke it as a label, it twists the discussion into an ideological one.
And there's no real reason to do so. He could have just said something like: "Don't be too conservative or set in your ways when it comes to technology. When something new comes along and makes to uncomfortable, rather than try to revert, see if there's a new perspective that shows a better way of doing things." The difference is that is simply a suggestion about how everyone can improve personally, rather than an ideological battle.
comment 13y ago · link · parent
There are ideological battles in technology, of course. But it doesn't have much to do with a lack of vision. If someone lacks vision, and then you make something amazing, they will generally acknowledge it (though perhaps slowly) and everyone moves on. Sure, there are a few people still using DOS, but not very many.
comment 13y ago · link · parent
As others have pointed out, some kind of conventions must be established around the semantics, and something must be done to avoid redundancy (which leads to inconsistency) and ambiguity.
I agree with those criticisms, but if the community also helps develop the schema, it will be interesting to see. What collisions will happen? What will be the result of queries that reach far across disciplines?
comment 13y ago · link · parent
I think some redundancy is a practical necessity, regardless of your approach (using database constraints or only application code). Consider registering a unique username: even if you check for availability beforehand, you still need to handle the race condition. That's guaranteed to be a somewhat awkward user interaction because they thought it was available but you found out that it was taken by a concurrent user.
So, your application always needs to have a nice way to avoid errors when they can be caught early (e.g. javascript check while filling out the form), and a less-nice way of handling errors when they can't (e.g. "sorry, that name has already been registered" after submitting the form).
There are SQL-standard codes for many constraint errors, so those can be turned into exceptions.
For things like CHECK constraints, think of those more like an assert: intentionally redundant.
comment 13y ago · link · parent
There is some lower bound to the amount of time that it takes to learn something (absent some educational revolution). Many people aren't even willing to pay that lower bound simply because they have other priorities in life. But they do like to sample (which is good), and potentially finish out a course if nothing else gets in the way.
Online courses are great because they lower the cost of sampling, so we shouldn't be surprised that there are more samplers, and fewer people finishing out the courses. If 1000 people complete an online course, then that's great, even if 99000 people signed up and disappeared a week later.
That being said, I'm pleased to see the specific criticisms offered in the article, and I hope they lead to a better balance for more people.