HN user

lneves

307 karma
Posts5
Comments21
View on HN

I've been using postgres for a few years now, I also use MSSQL, MonetDB and MySQL.

Some of the things I miss most frequently are:

- Easy table partitioning.

- Support for "phrase search" in fts.

- MERGE/UPSERT support.

- Columnar storage (and related optimizations) for "OLAP like" workloads.

- EXPLAIN ANALYSE that traces functions.

I do not think that this is equivalent, it looks like querying complex JSON objects and not "simple" arrays.

From the "Array Element by Position" example:

  db.blogposts.find( { "comments.0.by" : "Abe" } )
PostgreSQL doesn't have JSON support but it does have XML/Xpath support.

If you stored XML documents in PostgreSQL the similar query to the MongoDB one would be something like this:

  select * from blogposts where (xpath('/comments[0]/@by', doc))::text[] = array['Abe']
Yes it's a little more verbose but not terrible so... at least in my opinion.

Yes I've looked at them. I use them every day. The example you posted its difficult to parse because it deals with multidimensional arrays and also populating one in the inner query. The simple, and much more common case of one dimension arrays is very straightforward. Can you show me the equivalent in MongoDB?

About the performance/scalability warning; I don't deal with very large arrays, a couple hundred items max, and when using a GIN index over the array field, search queries are screamingly fast.

I would be interested to know if sports like cycling also have some kind of the negative health impact caused by the long periods of "sitting down".

If your objects have a wide variety of attributes, either you need lots of columns with many of them empty, or you need some sort of attribute table with object-key-value triples. Both are bad relational design, but the structure is inherent in the data. If you're having to use a fixed DB schema, I can't see any way around bad design.

PostgreSQL HStore is very handy in situations such as this: http://www.postgresql.org/docs/8.3/static/hstore.html

No way JVM starts in under a second: it's more like 2 full seconds on his hardware.

My machine has lower hardware specs than what the article mentions. This is what i get.

$ java -version

java version "1.6.0_10"

Java(TM) SE Runtime Environment (build 1.6.0_10-b33)

Java HotSpot(TM) 64-Bit Server VM (build 11.0-b15, mixed mode)

$ uname -a

Linux lneves-t61p 2.6.27-9-generic #1 SMP Thu Nov 20 22:15:32 UTC 2008 x86_64 GNU/Linux

$ echo "public class Test{public static void main(String[] args) {System.out.println(\"Hello World\");}}" > Test.java

$ javac Test.java

$ time java Test

Hello World

real 0m0.174s

user 0m0.068s

sys 0m0.016s

It seems that you are wrong.

More likely he had some of JVM in the filesystem cache. Vista/OSX will pre-fetch JVM modules even after you reboot (not sure about Linux) if you run Java software and especially if you have 8GB of RAM...

Do you mean Class Data Sharing?

http://java.sun.com/j2se/1.5.0/docs/guide/vm/class-data-shar...

Lets disable it:

$ time java -Xshare:off Test

Hello World

real 0m0.165s

user 0m0.060s

sys 0m0.040s

Not much of a difference.

> When using pgAdmin3, I am forced to expand Servers->Local Server->Databases-><the desired database>->Schema->Public->Tables

Yes, that is annoying, but at least the 1.8.1 version of pgAdmin opens in the last db/schema used... that is the behavior I get.

> So I figure out I must click the table icon on the toolbar to bring up the table. Instead of bringing up the data within the same pane, it pops up a second window? Grrr....

File -> Options -> Preferences. Unmark "Show object properties on doubleclick in treeview?" Does that help?