Skip to content

Commit

Permalink
Merge fc6bd39 into 134f009
Browse files Browse the repository at this point in the history
  • Loading branch information
marcocitus committed Dec 4, 2018
2 parents 134f009 + fc6bd39 commit 7282bc4
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 2 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Expand Up @@ -23,7 +23,6 @@ before_install:
- nuke_pg
install:
- sudo apt-get install protobuf-c-compiler
- sudo apt-get install libprotobuf-c0-dev
- sudo locale-gen da_DK
- sudo locale-gen da_DK.utf8
- sudo pip install cpp-coveralls
Expand Down
1 change: 0 additions & 1 deletion README.md
Expand Up @@ -46,7 +46,6 @@ So we need to install these packages first:

# Ubuntu 10.4+
sudo apt-get install protobuf-c-compiler
sudo apt-get install libprotobuf-c0-dev

# Mac OS X
brew install protobuf-c
Expand Down
27 changes: 27 additions & 0 deletions cstore_fdw.c
Expand Up @@ -140,6 +140,10 @@ static TupleTableSlot * CStoreExecForeignInsert(EState *executorState,
TupleTableSlot *tupleSlot,
TupleTableSlot *planSlot);
static void CStoreEndForeignModify(EState *executorState, ResultRelInfo *relationInfo);
#if PG_VERSION_NUM >= 90600
static bool CStoreIsForeignScanParallelSafe(PlannerInfo *root, RelOptInfo *rel,
RangeTblEntry *rte);
#endif


/* declarations for dynamic loading */
Expand Down Expand Up @@ -1206,6 +1210,10 @@ cstore_fdw_handler(PG_FUNCTION_ARGS)
fdwRoutine->ExecForeignInsert = CStoreExecForeignInsert;
fdwRoutine->EndForeignModify = CStoreEndForeignModify;

#if PG_VERSION_NUM >= 90600
fdwRoutine->IsForeignScanParallelSafe = CStoreIsForeignScanParallelSafe;
#endif

PG_RETURN_POINTER(fdwRoutine);
}

Expand Down Expand Up @@ -2302,3 +2310,22 @@ CStoreEndForeignModify(EState *executorState, ResultRelInfo *relationInfo)
}
}


#if PG_VERSION_NUM >= 90600
/*
* CStoreIsForeignScanParallelSafe always returns true to indicate that
* reading from a cstore_fdw table in a parallel worker is safe. This
* does not enable parallelism for queries on individual cstore_fdw
* tables, but does allow parallel scans of cstore_fdw partitions.
*
* cstore_fdw is parallel-safe because all writes are immediately committed
* to disk and then read from disk. There is no uncommitted state that needs
* to be shared across processes.
*/
static bool
CStoreIsForeignScanParallelSafe(PlannerInfo *root, RelOptInfo *rel,
RangeTblEntry *rte)
{
return true;
}
#endif

0 comments on commit 7282bc4

Please sign in to comment.