Skip to content

Commit

Permalink
mongo_fdw is upgraded to postgresql-9.2 including analyze feauture.
Browse files Browse the repository at this point in the history
  • Loading branch information
metdos committed Mar 14, 2013
1 parent 5da5861 commit 626b995
Show file tree
Hide file tree
Showing 2 changed files with 430 additions and 120 deletions.
16 changes: 9 additions & 7 deletions README
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
MongoDB FDW for PostgreSQL 9.1
MongoDB FDW for PostgreSQL 9.2
==============================

This PostgreSQL extension implements a Foreign Data Wrapper (FDW) for MongoDB.
For an example setup that demonstrates this wrapper's use, please see
http://www.citusdata.com/blog/51-run-sql-on-mongodb. Please also note that this
version of mongo_fdw only works with PostgreSQL 9.1.
version of mongo_fdw only works with PostgreSQL 9.2.


Building
Expand Down Expand Up @@ -45,6 +45,10 @@ collection. The commands also show specifying option values in the OPTIONS
clause. If an option value isn't provided, the wrapper uses the default value
mentioned above.

mongo_fdw can collect data distribution statistics and incorporates them when
estimating costs for the query execution plan. In the mean time, you run EXPLAIN
on your queries to see the selected execution plans.

We also currently use the internal PostgreSQL NAME type to represent the BSON
object identifier type (_id field).

Expand All @@ -71,6 +75,9 @@ CREATE FOREIGN TABLE customer_reviews
SERVER mongo_server
OPTIONS (database 'test', collection 'customer_reviews');

-- collect data distribution statistics
ANALYZE customer_reviews;


Limitations
-----------
Expand All @@ -84,11 +91,6 @@ Limitations
If you need column names that are longer, you can increase the NAMEDATALEN
constant in src/include/pg_config_manual.h, compile, and reinstall.

* mongo_fdw only incorporates the document count and average document size when
estimating costs for the query execution plan. A better estimate also includes
data distribution statistics; and PostgreSQL 9.2 allows for this. In the mean
time, you run EXPLAIN on your queries to see the selected execution plans.


Copyright
---------
Expand Down
Loading

0 comments on commit 626b995

Please sign in to comment.