7,244 karma · joined Sep 25, 2010 (16y ago) · 2,593 submissions
comment 13y ago · link · parent
The FAA gave a talk a few years ago about how they moved from Oracle spatial (if I remember correctly) to Postgres/PostGIS for cost reasons, and it turned out to be significantly better all around.
Some links (couldn't find a good primary source): https://twitter.com/magnushagander/status/11107130700 http://scanningpages.wordpress.com/2010/04/11/pg-east-2010-2...
comment 13y ago · link · parent
PostgreSQL has spent a lot of effort on the extension framework ("create extension") to make it easier to support more external modules. If there is a particular area that needs improving, please elaborate.
Making external modules a normal part of the ecosystem, like with ruby (and other popular languages), is the way forward for postgres and has some major advantages.
For instance, given that PostGIS 2.1.0 was just released today, it would make it into 9.4 (as 9.3 is already feature frozen), and 9.4 will be released in about a year. Because it's an extension, you can install it in 9.2 today, or 9.3 when it comes out in a month or so.
Also, just plain modularity, division of responsibilities, allowing for different licensing, and lowering the barrier for contribution are huge wins. The same reasons that ruby has gems.
So, hopefully we can address the concerns with extensions rather than build PostGIS into core.
comment 13y ago · link · parent
On the "Right", people often conclude that, because their religion is good, it should be enforced by the federal government. In reality, people can (generally) practice their religion freely through their church so long as the government policies aren't too overbearing.
On the "Left", people often conclude that, because charitable giving and safety nets and community projects are good, those things should be enforced and run by the federal government. In reality, there are many social institutions and mechanisms by which those things might happen (families and communities do many of these things already, and local governments can do many more), and the federal government is only one option and may only be suitable in specific circumstances.
comment 13y ago · link · parent
The other kind of pension, which we generally hear about in large companies or governments, is indistinguishable (to me) from accounting fraud. The whole point is to make the business (or government) look better today, and make big promises today, and hide the costs and obligations far into the future with optimistic projections.
I am not a lawyer or expert on this matter.
comment 13y ago · link · parent
Not sure exactly what you mean here. The protocol and libpq support sending literal values entirely outside of the query itself. There is no reason for the DB driver to do any parsing.
comment 13y ago · link · parent
Unfortunately, it seems a bit awkward to differentiate between empty and NULL strings. That's something to be careful of.
Also, I really think this should be included in the blog post, even if it's simple. Protecting against SQL injection is not optional, so leaving it out only muddies the comparison with more traditional frameworks. Also, there's always going to be someone that copies and pastes it without thinking much about it.
That being said, this is very cool and I hope to see more development and exploration in this area.
comment 13y ago · link · parent
Granted, the population is smaller than the Baltic states, but the population of the Baltic states is also smaller than that of Russia.
[1] http://en.wikipedia.org/wiki/Demographic_history_of_Detroit
comment 13y ago · link · parent
Of course, there are some details that might cause problems. A landlord might expect more headaches and confusion from someone subletting the place, and may want to raise the rent to compensate.
Also, just because it's inefficient doesn't mean that it's easy to solve. Copyright is obviously inefficient, but not easy to solve.
comment 13y ago · link · parent
If a business makes sense, and consumers get a taste of it and have positive experiences, it's very hard to stop[1]. Institutional inefficiencies usually only last when better solutions are adequately hidden from consumers.
I was pretty skeptical of AirBnb a while ago because I underestimated the effectiveness of trust and rating systems. I thought that the initial excitement was really just because the system masked the risks people were taking. I should have known from eBay that it can be done.
If they do have the trust thing worked out pretty well, then it's a very solid business model. Net travel from any one city is generally close to zero[2], so having a ton of hotels is pretty inefficient.
(I'm not an airbnb user, but I see why it's appealing.)
[1] It could really only be stopped if airbnb were somehow vilified. For instance, if newspapers started running stories like "downtown overrun by out-of-town vandals using airbnb" (just to give an absurd example).
[2] It varies seasonally, of course, which might mean that there are more people in tourist areas in the summer, causing a need for things like hotels. But many tourist destinations are also major cities, with their own residents leaving on holiday as well.
comment 13y ago · link · parent
There are a lot of jobs like this, where the threat of discomfort is the primary motivator. Across the economy it would take a huge amount of money to incentivize already-comfortable people to do them.
And if the jobs don't get done, then someone else is uncomfortable.
comment 13y ago · link · parent
* What if the money you pay someone does not go as far as expected? Maybe they lose some of the money in various ways, or maybe they are just very bad at negotiating economic transactions or buy the wrong kinds of things from the wrong places. Maybe they are trying to live in an expensive area -- do we kick them out?
* There will be a significant class of people who simply know nothing at all about work or participation in the economy. That may have all kinds of bad effects for those people, one of which may be a greater likelihood of the problem above.
* Some people who would otherwise be productive will put off both education and work for a while. When the time comes that they want to be involved, it will be hard for them to make the transition, and many will just stay out of the workforce forever. So, some of the ultra-productive people the author is expecting to do the heavy lifting will not exist.
* There will be pressure to stop granting new citizenship/residency to almost anyone, because the potential cost will go way up. Even if, in the long term, immigrants are good for the economy, in the short term it could be crushing if each one gets a comfortable living regardless of work.
* There will be an imbalance in which jobs are actually done. The number of computer programmers might be higher, but the number of nurses might go way down. If having a nurse is required to make some people comfortable, how do we remedy that?
* "Comfort" in general is a moving target in this process because changing the basic income will have a big effect on the economy. It's hard to say whether you could ever really find a stable value that offers anything resembling "comfort" for those living on it.
comment 13y ago · link · parent
Expose them to a fraction of the consequences, rather than all of them.
My point was not that one approach is good and another not. It's a trade-off (between adequate assistance and incentives to make good choices) and the trades are implicit in every act of assistance, whether at the family or government level.
The best approach is to make good trades that provide the most assistance without steering people too much towards bad decisions.
It's easier to do that in a localized (or better yet, personalized) way than using central planning on a 300M-person scale. The reason is that there are many more options to get people back on track when dealing with a problem at the local level. A government of 300M people can't do much more than throw money at the problem, which is not nearly as good of a trade-off.
comment 13y ago · link · parent
But we can do things to steer people toward good decisions or bad decisions. Your argument is a little too deterministic/fatalistic, as though things just kind of happen.
Directly applying empathy to policy sometimes steers people toward bad decisions. That's just the unfortunate reality of incentives; in some cases worse than others.
One way of steering people toward good decisions is to expose them to some of the consequences of their bad choices. That has some major advantages: (1) it's easy to implement and fairly natural; (2) it doesn't require central planning; (3) it preserves a lot of freedom to make a wide variety of choices, not all of which have to be perfect. Unfortunately, it also has the disadvantage that mistakes and misfortunes cause major problems -- not just for the individuals, but also for the rest of society.
I believe the best trade-offs are when social assistance is provided by the most local organization that can provide it, starting with the immediate family and going up to about the size of a U.S. state at most. In a family or community, social assistance comes after years of listening to advice and with many social strings attached (usually by the more successful community members). The advice helps avoid the need for assistance; the social strings are a deterrent from bad choices and help people get back to making good decisions.
For example, reproductive choices vary widely between cultures, and I believe that's a caused by things like taboos and shame. Of course, taboos and shame have their own problems because they are applied imprecisely and are sometimes outdated. Sometimes, that results in even worse decisions, like staying in an abusive relationship or not entering a good one. I didn't claim to have all the answers.
comment 13y ago · link · parent
1. Write a bunch of code to pull the data from both sources and join it in the application. You have to pick a join algorithm at the beginning, and if your data changes you may need to rewrite it later.
2. Add a remote table in the database and just do the join there. The database can use statistics to pick a join algorithm for you.
I'm sure there are cases where you'd pick #1. But in many cases, the database offers a feature that allows you to implement a solution and call it "done" in minutes or hours where an application-based solution would drag on for days or weeks and carry a larger maintenance burden.
comment 13y ago · link · parent
In context, the alternatives available are something like:
1. Issue one recursive query 2. Issue many non-recursive queries 3. Use some kind of denormalized structure that is tuned to the one specific recursive query in question, but might perform badly on other queries.
#3 can work if you are focusing on the optimization of a single query and can pick a structure tuned to that one query. You can even parallelize it, because you can know the partitioning scheme that will work best for that one query. But outside of those constraints, or if the query profile changes over time, it does not work well. You end up needing to duplicate the data into many different structures to accommodate many different queries.
And I don't see how #2 has any advantage over #1 performance wise. Add caching layers or other performance hacks as needed.
comment 13y ago · link · parent
They are -- you can question whether they are a good steward or not, but that is irrelevant as far as I can tell. The government didn't give them the option of keeping their users' information private.
"Its not a "search" of you to get information google keeps about you using government powers."
You assert that, but I don't see why. Clearly they were trying to find something in all of that data -- if trying to find something is not a search, what is?
"The framers did not contemplate that people would freely hand over private information to third parties who have no legal obligations to protect it."
It doesn't matter whether they have a legal obligation to protect it or not. They weren't given an option to protect it. If I write you a letter about a new political party platform, you have no legal obligation to keep that a secret. But do you think it's reasonable for the government to come in and demand all of the letters you've ever received, and then browse through them to see if someone might be starting a radical political movement?
comment 13y ago · link · parent
If the government was just browsing Facebook or doing Google searches, nobody would complain. But they are using government powers to get the information, which means that it is a search.
comment 13y ago · link · parent
(a) Believe one thing (b) Understand that the "accepted fact" contradicts their belief
If no money is on the line, this reasonable person will state their belief. If money is on the line, they are more likely to state whatever they think the "accepted fact" is, regardless of their true belief.
In politics, there are many things for which minor differences in interpretation can cause a "fact" to change between true, false, and unknown. Inflation is certainly one of those things.
comment 13y ago · link · parent
CREATE UNIQUE INDEX foo_fidx ON foo (lower(a));
Will reject values of "a" that have the same lower-case value as something that already exists, even if the values of "a" are different. Exclusion Constraints[1] can make use of this, as well.Also, you can do partial indexes, which have a WHERE clause. You can combine those with unique indexes, too:
CREATE UNIQUE INDEX foo_idx ON foo (lower(a))
WHERE b <> 0;
Exclusion constraints also accept a WHERE clause.Additionally, if you do a partial and/or functional index, then postgres will collect stats specific to the function and predicate, which improves plans even if the index isn't used.
[1] http://www.postgresql.org/docs/current/static/sql-createtabl...
comment 13y ago · link · parent
This "try the plan out" idea has come up many times, and it's a reasonable idea, but it's nothing new and not a complete solution. You need a way to evaluate whether a plan has a reasonable chance of being the best one before the whole plan is even constructed, much less executed.
Combinatorial explosion is also one of the reasons that humans generally aren't great at coming up with non-trivial plans, either.
A good optimizer is a combination of many good ideas; so I don't mean to be discouraging, just that one idea is not the full story.
If you are worried about the risk of a changing plan, you are between a rock and a hard place. If you lock the plan down (or hard-code it in the application), and the data characteristics change, that could be disastrous. If you don't lock it down, that's a leap of faith that the optimizer will adapt gracefully.