mirror of https://github.com/citusdata/citus.git
Changed product name to citus
All citusdb references in - extension, binary names - file headers - all configuration name prefixes - error/warning messages - some functions names - regression tests are changed to be citus.pull/337/head
parent
334f800016
commit
55c44b48dd
12
Makefile
12
Makefile
|
@ -1,11 +1,11 @@
|
||||||
# CitusDB toplevel Makefile
|
# Citus toplevel Makefile
|
||||||
|
|
||||||
citusdb_subdir = .
|
citus_subdir = .
|
||||||
citusdb_top_builddir = .
|
citus_top_builddir = .
|
||||||
|
|
||||||
# Hint that configure should be run first
|
# Hint that configure should be run first
|
||||||
ifeq (,$(wildcard Makefile.global))
|
ifeq (,$(wildcard Makefile.global))
|
||||||
$(error ./configure needs to be run before compiling CitusDB)
|
$(error ./configure needs to be run before compiling Citus)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
include Makefile.global
|
include Makefile.global
|
||||||
|
@ -20,9 +20,9 @@ install-extension:
|
||||||
install-headers:
|
install-headers:
|
||||||
$(MKDIR_P) '$(includedir_server)/distributed/'
|
$(MKDIR_P) '$(includedir_server)/distributed/'
|
||||||
# generated headers are located in the build directory
|
# generated headers are located in the build directory
|
||||||
$(INSTALL_DATA) src/include/citusdb_config.h '$(includedir_server)/'
|
$(INSTALL_DATA) src/include/citus_config.h '$(includedir_server)/'
|
||||||
# the rest in the source tree
|
# the rest in the source tree
|
||||||
$(INSTALL_DATA) $(citusdb_abs_srcdir)/src/include/distributed/*.h '$(includedir_server)/distributed/'
|
$(INSTALL_DATA) $(citus_abs_srcdir)/src/include/distributed/*.h '$(includedir_server)/distributed/'
|
||||||
clean-extension:
|
clean-extension:
|
||||||
$(MAKE) -C src/backend/distributed/ clean
|
$(MAKE) -C src/backend/distributed/ clean
|
||||||
.PHONY: extension install-extension clean-extension
|
.PHONY: extension install-extension clean-extension
|
||||||
|
|
|
@ -9,40 +9,40 @@
|
||||||
# makefiles, particulary central handling of compilation flags and
|
# makefiles, particulary central handling of compilation flags and
|
||||||
# rules.
|
# rules.
|
||||||
|
|
||||||
citusdb_abs_srcdir:=@abs_top_srcdir@/${citusdb_subdir}
|
citus_abs_srcdir:=@abs_top_srcdir@/${citus_subdir}
|
||||||
citusdb_abs_top_srcdir:=@abs_top_srcdir@
|
citus_abs_top_srcdir:=@abs_top_srcdir@
|
||||||
PG_CONFIG:=@PG_CONFIG@
|
PG_CONFIG:=@PG_CONFIG@
|
||||||
PGXS:=$(shell $(PG_CONFIG) --pgxs)
|
PGXS:=$(shell $(PG_CONFIG) --pgxs)
|
||||||
|
|
||||||
# Support for VPATH builds (i.e. builds from outside the source tree)
|
# Support for VPATH builds (i.e. builds from outside the source tree)
|
||||||
vpath_build=@vpath_build@
|
vpath_build=@vpath_build@
|
||||||
ifeq ($(vpath_build),yes)
|
ifeq ($(vpath_build),yes)
|
||||||
VPATH:=$(citusdb_abs_srcdir)
|
VPATH:=$(citus_abs_srcdir)
|
||||||
USE_VPATH:=$(VPATH)
|
USE_VPATH:=$(VPATH)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# CitusDB is built using PostgreSQL's pgxs
|
# Citus is built using PostgreSQL's pgxs
|
||||||
USE_PGXS=1
|
USE_PGXS=1
|
||||||
include $(PGXS)
|
include $(PGXS)
|
||||||
|
|
||||||
# Remake Makefile.global from Makefile.global.in if the latter
|
# Remake Makefile.global from Makefile.global.in if the latter
|
||||||
# changed. In order to trigger this rule, the including file must
|
# changed. In order to trigger this rule, the including file must
|
||||||
# write `include $(citusdb_top_builddir)/Makefile.global', not some
|
# write `include $(citus_top_builddir)/Makefile.global', not some
|
||||||
# shortcut thereof. This makes it less likely to accidentally run
|
# shortcut thereof. This makes it less likely to accidentally run
|
||||||
# with some outdated Makefile.global.
|
# with some outdated Makefile.global.
|
||||||
# Make internally restarts whenever included Makefiles are
|
# Make internally restarts whenever included Makefiles are
|
||||||
# regenerated.
|
# regenerated.
|
||||||
$(citusdb_top_builddir)/Makefile.global: $(citusdb_top_builddir)/Makefile.global.in @top_srcdir@/configure $(citusdb_top_builddir)/config.status
|
$(citus_top_builddir)/Makefile.global: $(citus_top_builddir)/Makefile.global.in @top_srcdir@/configure $(citus_top_builddir)/config.status
|
||||||
cd @abs_top_builddir@ && ./config.status Makefile.global
|
cd @abs_top_builddir@ && ./config.status Makefile.global
|
||||||
|
|
||||||
# Ensure configuration is generated by the most recent configure,
|
# Ensure configuration is generated by the most recent configure,
|
||||||
# useful for longer existing build directories.
|
# useful for longer existing build directories.
|
||||||
$(citusdb_top_builddir)/config.status: @top_srcdir@/configure
|
$(citus_top_builddir)/config.status: @top_srcdir@/configure
|
||||||
cd @abs_top_builddir@ && ./config.status --recheck
|
cd @abs_top_builddir@ && ./config.status --recheck
|
||||||
|
|
||||||
# Regenerate configure if configure.in changed
|
# Regenerate configure if configure.in changed
|
||||||
@top_srcdir@/configure: $(citusdb_abs_srcdir)/configure.in
|
@top_srcdir@/configure: $(citus_abs_srcdir)/configure.in
|
||||||
cd ${citusdb_abs_srcdir} && ./autogen.sh
|
cd ${citus_abs_srcdir} && ./autogen.sh
|
||||||
|
|
||||||
# If specified via configure, replace the default compiler. Normally
|
# If specified via configure, replace the default compiler. Normally
|
||||||
# we'll build with the one postgres was built with. But it's useful to
|
# we'll build with the one postgres was built with. But it's useful to
|
||||||
|
@ -54,8 +54,8 @@ endif
|
||||||
|
|
||||||
# Add options passed to configure or computed therein, to CFLAGS/CPPFLAGS/...
|
# Add options passed to configure or computed therein, to CFLAGS/CPPFLAGS/...
|
||||||
override CFLAGS += @CFLAGS@ @CITUS_CFLAGS@
|
override CFLAGS += @CFLAGS@ @CITUS_CFLAGS@
|
||||||
override CPPFLAGS := @CPPFLAGS@ -I '${citusdb_abs_top_srcdir}/src/include' $(CPPFLAGS)
|
override CPPFLAGS := @CPPFLAGS@ -I '${citus_abs_top_srcdir}/src/include' $(CPPFLAGS)
|
||||||
override LDFLAGS += @LDFLAGS@
|
override LDFLAGS += @LDFLAGS@
|
||||||
|
|
||||||
# optional file with user defined, additional, rules
|
# optional file with user defined, additional, rules
|
||||||
-include ${citusdb_abs_srcdir}/src/Makefile.custom
|
-include ${citus_abs_srcdir}/src/Makefile.custom
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
#
|
#
|
||||||
# autogen.sh converts configure.in to configure and creates
|
# autogen.sh converts configure.in to configure and creates
|
||||||
# citusdb_config.h.in. The resuting resulting files are checked into
|
# citus_config.h.in. The resuting resulting files are checked into
|
||||||
# the SCM, to avoid everyone needing autoconf installed.
|
# the SCM, to avoid everyone needing autoconf installed.
|
||||||
|
|
||||||
autoreconf -f
|
autoreconf -f
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
# Guess values for system-dependent variables and create Makefiles.
|
# Guess values for system-dependent variables and create Makefiles.
|
||||||
# Generated by GNU Autoconf 2.69 for CitusDB 5.0.
|
# Generated by GNU Autoconf 2.69 for Citus 5.0.
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
|
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
|
||||||
|
@ -577,10 +577,10 @@ MFLAGS=
|
||||||
MAKEFLAGS=
|
MAKEFLAGS=
|
||||||
|
|
||||||
# Identity of this package.
|
# Identity of this package.
|
||||||
PACKAGE_NAME='CitusDB'
|
PACKAGE_NAME='Citus'
|
||||||
PACKAGE_TARNAME='citusdb'
|
PACKAGE_TARNAME='citus'
|
||||||
PACKAGE_VERSION='5.0'
|
PACKAGE_VERSION='5.0'
|
||||||
PACKAGE_STRING='CitusDB 5.0'
|
PACKAGE_STRING='Citus 5.0'
|
||||||
PACKAGE_BUGREPORT=''
|
PACKAGE_BUGREPORT=''
|
||||||
PACKAGE_URL=''
|
PACKAGE_URL=''
|
||||||
|
|
||||||
|
@ -1190,7 +1190,7 @@ if test "$ac_init_help" = "long"; then
|
||||||
# Omit some internal or obsolete options to make the list less imposing.
|
# Omit some internal or obsolete options to make the list less imposing.
|
||||||
# This message is too long to be a string in the A/UX 3.1 sh.
|
# This message is too long to be a string in the A/UX 3.1 sh.
|
||||||
cat <<_ACEOF
|
cat <<_ACEOF
|
||||||
\`configure' configures CitusDB 5.0 to adapt to many kinds of systems.
|
\`configure' configures Citus 5.0 to adapt to many kinds of systems.
|
||||||
|
|
||||||
Usage: $0 [OPTION]... [VAR=VALUE]...
|
Usage: $0 [OPTION]... [VAR=VALUE]...
|
||||||
|
|
||||||
|
@ -1238,7 +1238,7 @@ Fine tuning of the installation directories:
|
||||||
--infodir=DIR info documentation [DATAROOTDIR/info]
|
--infodir=DIR info documentation [DATAROOTDIR/info]
|
||||||
--localedir=DIR locale-dependent data [DATAROOTDIR/locale]
|
--localedir=DIR locale-dependent data [DATAROOTDIR/locale]
|
||||||
--mandir=DIR man documentation [DATAROOTDIR/man]
|
--mandir=DIR man documentation [DATAROOTDIR/man]
|
||||||
--docdir=DIR documentation root [DATAROOTDIR/doc/citusdb]
|
--docdir=DIR documentation root [DATAROOTDIR/doc/citus]
|
||||||
--htmldir=DIR html documentation [DOCDIR]
|
--htmldir=DIR html documentation [DOCDIR]
|
||||||
--dvidir=DIR dvi documentation [DOCDIR]
|
--dvidir=DIR dvi documentation [DOCDIR]
|
||||||
--pdfdir=DIR pdf documentation [DOCDIR]
|
--pdfdir=DIR pdf documentation [DOCDIR]
|
||||||
|
@ -1251,7 +1251,7 @@ fi
|
||||||
|
|
||||||
if test -n "$ac_init_help"; then
|
if test -n "$ac_init_help"; then
|
||||||
case $ac_init_help in
|
case $ac_init_help in
|
||||||
short | recursive ) echo "Configuration of CitusDB 5.0:";;
|
short | recursive ) echo "Configuration of Citus 5.0:";;
|
||||||
esac
|
esac
|
||||||
cat <<\_ACEOF
|
cat <<\_ACEOF
|
||||||
|
|
||||||
|
@ -1333,7 +1333,7 @@ fi
|
||||||
test -n "$ac_init_help" && exit $ac_status
|
test -n "$ac_init_help" && exit $ac_status
|
||||||
if $ac_init_version; then
|
if $ac_init_version; then
|
||||||
cat <<\_ACEOF
|
cat <<\_ACEOF
|
||||||
CitusDB configure 5.0
|
Citus configure 5.0
|
||||||
generated by GNU Autoconf 2.69
|
generated by GNU Autoconf 2.69
|
||||||
|
|
||||||
Copyright (C) 2012 Free Software Foundation, Inc.
|
Copyright (C) 2012 Free Software Foundation, Inc.
|
||||||
|
@ -1390,7 +1390,7 @@ cat >config.log <<_ACEOF
|
||||||
This file contains any messages produced by compilers while
|
This file contains any messages produced by compilers while
|
||||||
running configure, to aid debugging if configure makes a mistake.
|
running configure, to aid debugging if configure makes a mistake.
|
||||||
|
|
||||||
It was created by CitusDB $as_me 5.0, which was
|
It was created by Citus $as_me 5.0, which was
|
||||||
generated by GNU Autoconf 2.69. Invocation command line was
|
generated by GNU Autoconf 2.69. Invocation command line was
|
||||||
|
|
||||||
$ $0 $@
|
$ $0 $@
|
||||||
|
@ -1871,7 +1871,7 @@ if test -z "$version_num"; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test "$version_num" != '9.4' -a "$version_num" != '9.5'; then
|
if test "$version_num" != '9.4' -a "$version_num" != '9.5'; then
|
||||||
as_fn_error $? "CitusDB is not compatible with the detected PostgreSQL version ${version_num}." "$LINENO" 5
|
as_fn_error $? "Citus is not compatible with the detected PostgreSQL version ${version_num}." "$LINENO" 5
|
||||||
else
|
else
|
||||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: building against PostgreSQL $version_num" >&5
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: building against PostgreSQL $version_num" >&5
|
||||||
$as_echo "$as_me: building against PostgreSQL $version_num" >&6;}
|
$as_echo "$as_me: building against PostgreSQL $version_num" >&6;}
|
||||||
|
@ -2893,7 +2893,7 @@ CITUS_CFLAGS="$CITUS_CFLAGS"
|
||||||
|
|
||||||
ac_config_files="$ac_config_files Makefile.global"
|
ac_config_files="$ac_config_files Makefile.global"
|
||||||
|
|
||||||
ac_config_headers="$ac_config_headers src/include/citusdb_config.h"
|
ac_config_headers="$ac_config_headers src/include/citus_config.h"
|
||||||
|
|
||||||
|
|
||||||
cat >confcache <<\_ACEOF
|
cat >confcache <<\_ACEOF
|
||||||
|
@ -3402,7 +3402,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
|
||||||
# report actual input values of CONFIG_FILES etc. instead of their
|
# report actual input values of CONFIG_FILES etc. instead of their
|
||||||
# values after options handling.
|
# values after options handling.
|
||||||
ac_log="
|
ac_log="
|
||||||
This file was extended by CitusDB $as_me 5.0, which was
|
This file was extended by Citus $as_me 5.0, which was
|
||||||
generated by GNU Autoconf 2.69. Invocation command line was
|
generated by GNU Autoconf 2.69. Invocation command line was
|
||||||
|
|
||||||
CONFIG_FILES = $CONFIG_FILES
|
CONFIG_FILES = $CONFIG_FILES
|
||||||
|
@ -3464,7 +3464,7 @@ _ACEOF
|
||||||
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
|
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
|
||||||
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
|
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
|
||||||
ac_cs_version="\\
|
ac_cs_version="\\
|
||||||
CitusDB config.status 5.0
|
Citus config.status 5.0
|
||||||
configured by $0, generated by GNU Autoconf 2.69,
|
configured by $0, generated by GNU Autoconf 2.69,
|
||||||
with options \\"\$ac_cs_config\\"
|
with options \\"\$ac_cs_config\\"
|
||||||
|
|
||||||
|
@ -3586,7 +3586,7 @@ for ac_config_target in $ac_config_targets
|
||||||
do
|
do
|
||||||
case $ac_config_target in
|
case $ac_config_target in
|
||||||
"Makefile.global") CONFIG_FILES="$CONFIG_FILES Makefile.global" ;;
|
"Makefile.global") CONFIG_FILES="$CONFIG_FILES Makefile.global" ;;
|
||||||
"src/include/citusdb_config.h") CONFIG_HEADERS="$CONFIG_HEADERS src/include/citusdb_config.h" ;;
|
"src/include/citus_config.h") CONFIG_HEADERS="$CONFIG_HEADERS src/include/citus_config.h" ;;
|
||||||
|
|
||||||
*) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
|
*) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
|
||||||
esac
|
esac
|
||||||
|
|
12
configure.in
12
configure.in
|
@ -1,11 +1,11 @@
|
||||||
# CitusDB autoconf input script.
|
# Citus autoconf input script.
|
||||||
#
|
#
|
||||||
# Converted into an actual configure script by autogen.sh. This
|
# Converted into an actual configure script by autogen.sh. This
|
||||||
# conversion only has to be done when configure.in changes. To avoid
|
# conversion only has to be done when configure.in changes. To avoid
|
||||||
# everyone needing autoconf installed, the resulting files are checked
|
# everyone needing autoconf installed, the resulting files are checked
|
||||||
# into the SCM.
|
# into the SCM.
|
||||||
|
|
||||||
AC_INIT([CitusDB], [5.0], [], [citusdb], [])
|
AC_INIT([Citus], [5.0], [], [citus], [])
|
||||||
AC_COPYRIGHT([Copyright (c) Copyright (c) 2012-2015, Citus Data, Inc.])
|
AC_COPYRIGHT([Copyright (c) Copyright (c) 2012-2015, Citus Data, Inc.])
|
||||||
|
|
||||||
AC_PROG_SED
|
AC_PROG_SED
|
||||||
|
@ -32,7 +32,7 @@ if test -z "$version_num"; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test "$version_num" != '9.4' -a "$version_num" != '9.5'; then
|
if test "$version_num" != '9.4' -a "$version_num" != '9.5'; then
|
||||||
AC_MSG_ERROR([CitusDB is not compatible with the detected PostgreSQL version ${version_num}.])
|
AC_MSG_ERROR([Citus is not compatible with the detected PostgreSQL version ${version_num}.])
|
||||||
else
|
else
|
||||||
AC_MSG_NOTICE([building against PostgreSQL $version_num])
|
AC_MSG_NOTICE([building against PostgreSQL $version_num])
|
||||||
fi;
|
fi;
|
||||||
|
@ -96,11 +96,11 @@ CITUSAC_PROG_CC_CFLAGS_OPT([-Wmissing-prototypes])
|
||||||
AC_SUBST(CITUS_CFLAGS, "$CITUS_CFLAGS")
|
AC_SUBST(CITUS_CFLAGS, "$CITUS_CFLAGS")
|
||||||
|
|
||||||
AC_CONFIG_FILES([Makefile.global])
|
AC_CONFIG_FILES([Makefile.global])
|
||||||
AC_CONFIG_HEADERS([src/include/citusdb_config.h])
|
AC_CONFIG_HEADERS([src/include/citus_config.h])
|
||||||
AH_TOP([
|
AH_TOP([
|
||||||
/*
|
/*
|
||||||
* citusdb_config.h.in is generated by autoconf/autoheader and
|
* citus_config.h.in is generated by autoconf/autoheader and
|
||||||
* converted into citusdb_config.h by configure. Include when code needs to
|
* converted into citus_config.h by configure. Include when code needs to
|
||||||
* depend on determinations made by configure.
|
* depend on determinations made by configure.
|
||||||
*
|
*
|
||||||
* Do not manually edit!
|
* Do not manually edit!
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
#
|
#
|
||||||
# CitusDB copy of PostgreSQL's config/prep_buildtree
|
# Citus copy of PostgreSQL's config/prep_buildtree
|
||||||
#
|
#
|
||||||
# This script prepares a CitusDB build tree for an out-of-tree/VPATH
|
# This script prepares a Citus build tree for an out-of-tree/VPATH
|
||||||
# build. It is intended to be run by the configure script.
|
# build. It is intended to be run by the configure script.
|
||||||
|
|
||||||
me=`basename $0`
|
me=`basename $0`
|
||||||
|
|
|
@ -10,4 +10,4 @@
|
||||||
/tmp_check*
|
/tmp_check*
|
||||||
|
|
||||||
# ignore latest install file
|
# ignore latest install file
|
||||||
citusdb--5.0.sql
|
citus--5.0.sql
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
# Makefile for the CitusDB extension
|
# Makefile for the Citus extension
|
||||||
|
|
||||||
citusdb_subdir = src/backend/distributed
|
citus_subdir = src/backend/distributed
|
||||||
citusdb_top_builddir = ../../..
|
citus_top_builddir = ../../..
|
||||||
|
|
||||||
MODULE_big = citusdb
|
MODULE_big = citus
|
||||||
EXTENSION = citusdb
|
EXTENSION = citus
|
||||||
EXTVERSION = 5.0
|
EXTVERSION = 5.0
|
||||||
DATA_built = $(EXTENSION)--$(EXTVERSION).sql
|
DATA_built = $(EXTENSION)--$(EXTVERSION).sql
|
||||||
SCRIPTS = $(wildcard $(citusdb_top_builddir)/src/bin/scripts/*)
|
SCRIPTS = $(wildcard $(citus_top_builddir)/src/bin/scripts/*)
|
||||||
|
|
||||||
# directories with source files
|
# directories with source files
|
||||||
SUBDIRS = . commands executor master planner relay test utils worker
|
SUBDIRS = . commands executor master planner relay test utils worker
|
||||||
|
@ -15,7 +15,7 @@ SUBDIRS = . commands executor master planner relay test utils worker
|
||||||
# That patsubst rule searches all directories listed in SUBDIRS for .c
|
# That patsubst rule searches all directories listed in SUBDIRS for .c
|
||||||
# files, and adds the corresponding .o files to OBJS
|
# files, and adds the corresponding .o files to OBJS
|
||||||
OBJS += \
|
OBJS += \
|
||||||
$(patsubst $(citusdb_abs_srcdir)/%.c,%.o,$(foreach dir,$(SUBDIRS), $(wildcard $(citusdb_abs_srcdir)/$(dir)/*.c)))
|
$(patsubst $(citus_abs_srcdir)/%.c,%.o,$(foreach dir,$(SUBDIRS), $(wildcard $(citus_abs_srcdir)/$(dir)/*.c)))
|
||||||
|
|
||||||
# define build process for latest install file
|
# define build process for latest install file
|
||||||
$(EXTENSION)--$(EXTVERSION).sql: $(EXTENSION).sql
|
$(EXTENSION)--$(EXTVERSION).sql: $(EXTENSION).sql
|
||||||
|
@ -28,6 +28,6 @@ NO_PGXS = 1
|
||||||
|
|
||||||
SHLIB_LINK = $(libpq)
|
SHLIB_LINK = $(libpq)
|
||||||
|
|
||||||
include $(citusdb_top_builddir)/Makefile.global
|
include $(citus_top_builddir)/Makefile.global
|
||||||
|
|
||||||
override CPPFLAGS += -I$(libpq_srcdir)
|
override CPPFLAGS += -I$(libpq_srcdir)
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
# Citus extension
|
||||||
|
comment = 'Citus distributed database'
|
||||||
|
default_version = '5.0'
|
||||||
|
module_pathname = '$libdir/citus'
|
||||||
|
relocatable = false
|
||||||
|
schema = pg_catalog
|
|
@ -1,24 +1,24 @@
|
||||||
/* citusdb.sql */
|
/* citus.sql */
|
||||||
|
|
||||||
-- complain if script is sourced in psql, rather than via CREATE EXTENSION
|
-- complain if script is sourced in psql, rather than via CREATE EXTENSION
|
||||||
\echo Use "CREATE EXTENSION citusdb" to load this file. \quit
|
\echo Use "CREATE EXTENSION citus" to load this file. \quit
|
||||||
|
|
||||||
CREATE SCHEMA citusdb;
|
CREATE SCHEMA citus;
|
||||||
|
|
||||||
-- Ensure CREATE EXTENSION is not run against an old citusdb data
|
-- Ensure CREATE EXTENSION is not run against an old citus data
|
||||||
-- directory, we're not compatible (due to the builtin functions/tables)
|
-- directory, we're not compatible (due to the builtin functions/tables)
|
||||||
DO $$
|
DO $$
|
||||||
BEGIN
|
BEGIN
|
||||||
IF EXISTS(SELECT * FROM pg_proc WHERE proname = 'worker_apply_shard_ddl_command') THEN
|
IF EXISTS(SELECT * FROM pg_proc WHERE proname = 'worker_apply_shard_ddl_command') THEN
|
||||||
RAISE 'cannot install citusdb extension in CitusDB 4 data directory';
|
RAISE 'cannot install citus extension in Citus 4 data directory';
|
||||||
END IF;
|
END IF;
|
||||||
END;
|
END;
|
||||||
$$;
|
$$;
|
||||||
|
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
* CitusDB data types
|
* Citus data types
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
CREATE TYPE citusdb.distribution_type AS ENUM (
|
CREATE TYPE citus.distribution_type AS ENUM (
|
||||||
'hash',
|
'hash',
|
||||||
'range',
|
'range',
|
||||||
'append'
|
'append'
|
||||||
|
@ -26,18 +26,18 @@ CREATE TYPE citusdb.distribution_type AS ENUM (
|
||||||
|
|
||||||
|
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
* CitusDB tables & corresponding indexes
|
* Citus tables & corresponding indexes
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
CREATE TABLE citusdb.pg_dist_partition(
|
CREATE TABLE citus.pg_dist_partition(
|
||||||
logicalrelid Oid NOT NULL,
|
logicalrelid Oid NOT NULL,
|
||||||
partmethod "char" NOT NULL,
|
partmethod "char" NOT NULL,
|
||||||
partkey text NOT NULL
|
partkey text NOT NULL
|
||||||
);
|
);
|
||||||
CREATE UNIQUE INDEX pg_dist_partition_logical_relid_index
|
CREATE UNIQUE INDEX pg_dist_partition_logical_relid_index
|
||||||
ON citusdb.pg_dist_partition using btree(logicalrelid);
|
ON citus.pg_dist_partition using btree(logicalrelid);
|
||||||
ALTER TABLE citusdb.pg_dist_partition SET SCHEMA pg_catalog;
|
ALTER TABLE citus.pg_dist_partition SET SCHEMA pg_catalog;
|
||||||
|
|
||||||
CREATE TABLE citusdb.pg_dist_shard(
|
CREATE TABLE citus.pg_dist_shard(
|
||||||
logicalrelid oid NOT NULL,
|
logicalrelid oid NOT NULL,
|
||||||
shardid int8 NOT NULL,
|
shardid int8 NOT NULL,
|
||||||
shardstorage "char" NOT NULL,
|
shardstorage "char" NOT NULL,
|
||||||
|
@ -46,12 +46,12 @@ CREATE TABLE citusdb.pg_dist_shard(
|
||||||
shardmaxvalue text
|
shardmaxvalue text
|
||||||
);
|
);
|
||||||
CREATE UNIQUE INDEX pg_dist_shard_shardid_index
|
CREATE UNIQUE INDEX pg_dist_shard_shardid_index
|
||||||
ON citusdb.pg_dist_shard using btree(shardid);
|
ON citus.pg_dist_shard using btree(shardid);
|
||||||
CREATE INDEX pg_dist_shard_logical_relid_index
|
CREATE INDEX pg_dist_shard_logical_relid_index
|
||||||
ON citusdb.pg_dist_shard using btree(logicalrelid);
|
ON citus.pg_dist_shard using btree(logicalrelid);
|
||||||
ALTER TABLE citusdb.pg_dist_shard SET SCHEMA pg_catalog;
|
ALTER TABLE citus.pg_dist_shard SET SCHEMA pg_catalog;
|
||||||
|
|
||||||
CREATE TABLE citusdb.pg_dist_shard_placement(
|
CREATE TABLE citus.pg_dist_shard_placement(
|
||||||
shardid int8 NOT NULL,
|
shardid int8 NOT NULL,
|
||||||
shardstate int4 NOT NULL,
|
shardstate int4 NOT NULL,
|
||||||
shardlength int8 NOT NULL,
|
shardlength int8 NOT NULL,
|
||||||
|
@ -59,40 +59,40 @@ CREATE TABLE citusdb.pg_dist_shard_placement(
|
||||||
nodeport int8 NOT NULL
|
nodeport int8 NOT NULL
|
||||||
) WITH oids;
|
) WITH oids;
|
||||||
CREATE UNIQUE INDEX pg_dist_shard_placement_oid_index
|
CREATE UNIQUE INDEX pg_dist_shard_placement_oid_index
|
||||||
ON citusdb.pg_dist_shard_placement using btree(oid);
|
ON citus.pg_dist_shard_placement using btree(oid);
|
||||||
CREATE INDEX pg_dist_shard_placement_shardid_index
|
CREATE INDEX pg_dist_shard_placement_shardid_index
|
||||||
ON citusdb.pg_dist_shard_placement using btree(shardid);
|
ON citus.pg_dist_shard_placement using btree(shardid);
|
||||||
CREATE INDEX pg_dist_shard_placement_nodeid_index
|
CREATE INDEX pg_dist_shard_placement_nodeid_index
|
||||||
ON citusdb.pg_dist_shard_placement using btree(nodename, nodeport);
|
ON citus.pg_dist_shard_placement using btree(nodename, nodeport);
|
||||||
ALTER TABLE citusdb.pg_dist_shard_placement SET SCHEMA pg_catalog;
|
ALTER TABLE citus.pg_dist_shard_placement SET SCHEMA pg_catalog;
|
||||||
|
|
||||||
|
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
* CitusDB sequences
|
* Citus sequences
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Unternal sequence to generate 64-bit shard ids. These identifiers are then
|
* Unternal sequence to generate 64-bit shard ids. These identifiers are then
|
||||||
* used to identify shards in the distributed database.
|
* used to identify shards in the distributed database.
|
||||||
*/
|
*/
|
||||||
CREATE SEQUENCE citusdb.pg_dist_shardid_seq
|
CREATE SEQUENCE citus.pg_dist_shardid_seq
|
||||||
MINVALUE 102008
|
MINVALUE 102008
|
||||||
NO CYCLE;
|
NO CYCLE;
|
||||||
ALTER SEQUENCE citusdb.pg_dist_shardid_seq SET SCHEMA pg_catalog;
|
ALTER SEQUENCE citus.pg_dist_shardid_seq SET SCHEMA pg_catalog;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* internal sequence to generate 32-bit jobIds. These identifiers are then
|
* internal sequence to generate 32-bit jobIds. These identifiers are then
|
||||||
* used to identify jobs in the distributed database; and they wrap at 32-bits
|
* used to identify jobs in the distributed database; and they wrap at 32-bits
|
||||||
* to allow for slave nodes to independently execute their distributed jobs.
|
* to allow for slave nodes to independently execute their distributed jobs.
|
||||||
*/
|
*/
|
||||||
CREATE SEQUENCE citusdb.pg_dist_jobid_seq
|
CREATE SEQUENCE citus.pg_dist_jobid_seq
|
||||||
MINVALUE 2 /* first jobId reserved for clean up jobs */
|
MINVALUE 2 /* first jobId reserved for clean up jobs */
|
||||||
MAXVALUE 4294967296;
|
MAXVALUE 4294967296;
|
||||||
ALTER SEQUENCE citusdb.pg_dist_jobid_seq SET SCHEMA pg_catalog;
|
ALTER SEQUENCE citus.pg_dist_jobid_seq SET SCHEMA pg_catalog;
|
||||||
|
|
||||||
|
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
* CitusDB functions
|
* Citus functions
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
/* For backward compatibility and ease of use create functions et al. in pg_catalog */
|
/* For backward compatibility and ease of use create functions et al. in pg_catalog */
|
||||||
|
@ -173,13 +173,13 @@ COMMENT ON FUNCTION master_get_round_robin_candidate_nodes(shard_id bigint)
|
||||||
|
|
||||||
CREATE FUNCTION master_create_distributed_table(table_name regclass,
|
CREATE FUNCTION master_create_distributed_table(table_name regclass,
|
||||||
distribution_column text,
|
distribution_column text,
|
||||||
distribution_method citusdb.distribution_type)
|
distribution_method citus.distribution_type)
|
||||||
RETURNS void
|
RETURNS void
|
||||||
LANGUAGE C STRICT
|
LANGUAGE C STRICT
|
||||||
AS 'MODULE_PATHNAME', $$master_create_distributed_table$$;
|
AS 'MODULE_PATHNAME', $$master_create_distributed_table$$;
|
||||||
COMMENT ON FUNCTION master_create_distributed_table(table_name regclass,
|
COMMENT ON FUNCTION master_create_distributed_table(table_name regclass,
|
||||||
distribution_column text,
|
distribution_column text,
|
||||||
distribution_method citusdb.distribution_type)
|
distribution_method citus.distribution_type)
|
||||||
IS 'define the table distribution functions';
|
IS 'define the table distribution functions';
|
||||||
|
|
||||||
-- define shard creation function for hash-partitioned tables
|
-- define shard creation function for hash-partitioned tables
|
||||||
|
@ -314,7 +314,7 @@ COMMENT ON FUNCTION worker_append_table_to_shard(text, text, text, integer)
|
||||||
|
|
||||||
/* trigger functions */
|
/* trigger functions */
|
||||||
|
|
||||||
CREATE OR REPLACE FUNCTION citusdb_drop_trigger()
|
CREATE OR REPLACE FUNCTION citus_drop_trigger()
|
||||||
RETURNS event_trigger
|
RETURNS event_trigger
|
||||||
LANGUAGE plpgsql
|
LANGUAGE plpgsql
|
||||||
SET search_path = pg_catalog
|
SET search_path = pg_catalog
|
||||||
|
@ -349,7 +349,7 @@ BEGIN
|
||||||
END LOOP;
|
END LOOP;
|
||||||
END;
|
END;
|
||||||
$cdbdt$;
|
$cdbdt$;
|
||||||
COMMENT ON FUNCTION citusdb_drop_trigger()
|
COMMENT ON FUNCTION citus_drop_trigger()
|
||||||
IS 'perform checks and actions at the end of DROP actions';
|
IS 'perform checks and actions at the end of DROP actions';
|
||||||
|
|
||||||
CREATE FUNCTION master_dist_partition_cache_invalidate()
|
CREATE FUNCTION master_dist_partition_cache_invalidate()
|
||||||
|
@ -369,21 +369,21 @@ COMMENT ON FUNCTION master_dist_shard_cache_invalidate()
|
||||||
|
|
||||||
/* internal functions, not user accessible */
|
/* internal functions, not user accessible */
|
||||||
|
|
||||||
CREATE FUNCTION citusdb_extradata_container(INTERNAL)
|
CREATE FUNCTION citus_extradata_container(INTERNAL)
|
||||||
RETURNS void
|
RETURNS void
|
||||||
LANGUAGE C
|
LANGUAGE C
|
||||||
AS 'MODULE_PATHNAME', $$citusdb_extradata_container$$;
|
AS 'MODULE_PATHNAME', $$citus_extradata_container$$;
|
||||||
COMMENT ON FUNCTION pg_catalog.citusdb_extradata_container(INTERNAL)
|
COMMENT ON FUNCTION pg_catalog.citus_extradata_container(INTERNAL)
|
||||||
IS 'placeholder function to store additional data in postgres node trees';
|
IS 'placeholder function to store additional data in postgres node trees';
|
||||||
|
|
||||||
|
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
* CitusDB triggers
|
* Citus triggers
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
CREATE EVENT TRIGGER citusdb_cascade_to_partition
|
CREATE EVENT TRIGGER citus_cascade_to_partition
|
||||||
ON SQL_DROP
|
ON SQL_DROP
|
||||||
EXECUTE PROCEDURE citusdb_drop_trigger();
|
EXECUTE PROCEDURE citus_drop_trigger();
|
||||||
|
|
||||||
CREATE TRIGGER dist_partition_cache_invalidate
|
CREATE TRIGGER dist_partition_cache_invalidate
|
||||||
AFTER INSERT OR UPDATE OR DELETE
|
AFTER INSERT OR UPDATE OR DELETE
|
||||||
|
@ -397,7 +397,7 @@ CREATE TRIGGER dist_shard_cache_invalidate
|
||||||
|
|
||||||
|
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
* CitusDB aggregates
|
* Citus aggregates
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
CREATE AGGREGATE array_cat_agg(anyarray) (SFUNC = array_cat, STYPE = anyarray);
|
CREATE AGGREGATE array_cat_agg(anyarray) (SFUNC = array_cat, STYPE = anyarray);
|
||||||
COMMENT ON AGGREGATE array_cat_agg(anyarray)
|
COMMENT ON AGGREGATE array_cat_agg(anyarray)
|
|
@ -1,6 +0,0 @@
|
||||||
# CitusDB extension
|
|
||||||
comment = 'CitusDB distributed database'
|
|
||||||
default_version = '5.0'
|
|
||||||
module_pathname = '$libdir/citusdb'
|
|
||||||
relocatable = false
|
|
||||||
schema = pg_catalog
|
|
|
@ -165,7 +165,7 @@ master_create_distributed_table(PG_FUNCTION_ARGS)
|
||||||
*
|
*
|
||||||
* Similarly, do not allow UNIQUE constraint and/or PRIMARY KEY if it does not
|
* Similarly, do not allow UNIQUE constraint and/or PRIMARY KEY if it does not
|
||||||
* include partition column. This check is important for two reasons. First,
|
* include partition column. This check is important for two reasons. First,
|
||||||
* currently CitusDB does not enforce uniqueness constraint on multiple shards.
|
* currently Citus does not enforce uniqueness constraint on multiple shards.
|
||||||
* Second, INSERT INTO .. ON CONFLICT (i.e., UPSERT) queries can be executed with no
|
* Second, INSERT INTO .. ON CONFLICT (i.e., UPSERT) queries can be executed with no
|
||||||
* further check for constraints.
|
* further check for constraints.
|
||||||
*/
|
*/
|
||||||
|
@ -191,7 +191,7 @@ master_create_distributed_table(PG_FUNCTION_ARGS)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* CitusDB cannot enforce uniqueness constraints with overlapping shards. Thus,
|
* Citus cannot enforce uniqueness constraints with overlapping shards. Thus,
|
||||||
* emit a warning for unique indexes on append partitioned tables.
|
* emit a warning for unique indexes on append partitioned tables.
|
||||||
*/
|
*/
|
||||||
if (distributionMethod == DISTRIBUTE_BY_APPEND)
|
if (distributionMethod == DISTRIBUTE_BY_APPEND)
|
||||||
|
@ -262,7 +262,7 @@ master_create_distributed_table(PG_FUNCTION_ARGS)
|
||||||
* necessary for a distributed relation in addition to the preexisting ones
|
* necessary for a distributed relation in addition to the preexisting ones
|
||||||
* for a normal relation.
|
* for a normal relation.
|
||||||
*
|
*
|
||||||
* We create one dependency from the (now distributed) relation to the citusdb
|
* We create one dependency from the (now distributed) relation to the citus
|
||||||
* extension to prevent the extension from being dropped while distributed
|
* extension to prevent the extension from being dropped while distributed
|
||||||
* tables exist. Furthermore a dependency from pg_dist_partition's
|
* tables exist. Furthermore a dependency from pg_dist_partition's
|
||||||
* distribution clause to the underlying columns is created, but it's marked
|
* distribution clause to the underlying columns is created, but it's marked
|
||||||
|
@ -281,7 +281,7 @@ RecordDistributedRelationDependencies(Oid distributedRelationId, Node *distribut
|
||||||
relationAddr.objectSubId = 0;
|
relationAddr.objectSubId = 0;
|
||||||
|
|
||||||
citusExtensionAddr.classId = ExtensionRelationId;
|
citusExtensionAddr.classId = ExtensionRelationId;
|
||||||
citusExtensionAddr.objectId = get_extension_oid("citusdb", false);
|
citusExtensionAddr.objectId = get_extension_oid("citus", false);
|
||||||
citusExtensionAddr.objectSubId = 0;
|
citusExtensionAddr.objectSubId = 0;
|
||||||
|
|
||||||
/* dependency from table entry to extension */
|
/* dependency from table entry to extension */
|
||||||
|
@ -294,10 +294,10 @@ RecordDistributedRelationDependencies(Oid distributedRelationId, Node *distribut
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* LookupDistributionMethod maps the oids of citusdb.distribution_type enum
|
* LookupDistributionMethod maps the oids of citus.distribution_type enum
|
||||||
* values to pg_dist_partition.partmethod values.
|
* values to pg_dist_partition.partmethod values.
|
||||||
*
|
*
|
||||||
* The passed in oid has to belong to a value of citusdb.distribution_type.
|
* The passed in oid has to belong to a value of citus.distribution_type.
|
||||||
*/
|
*/
|
||||||
static char
|
static char
|
||||||
LookupDistributionMethod(Oid distributionMethodOid)
|
LookupDistributionMethod(Oid distributionMethodOid)
|
||||||
|
|
|
@ -73,7 +73,7 @@ JobExecutorType(MultiPlan *multiPlan)
|
||||||
ereport(WARNING, (errmsg("this query uses more connections than the "
|
ereport(WARNING, (errmsg("this query uses more connections than the "
|
||||||
"configured max_connections limit"),
|
"configured max_connections limit"),
|
||||||
errhint("Consider increasing max_connections or setting "
|
errhint("Consider increasing max_connections or setting "
|
||||||
"citusdb.task_executor_type to "
|
"citus.task_executor_type to "
|
||||||
"\"task-tracker\".")));
|
"\"task-tracker\".")));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -88,7 +88,7 @@ JobExecutorType(MultiPlan *multiPlan)
|
||||||
ereport(WARNING, (errmsg("this query uses more file descriptors than the "
|
ereport(WARNING, (errmsg("this query uses more file descriptors than the "
|
||||||
"configured max_files_per_process limit"),
|
"configured max_files_per_process limit"),
|
||||||
errhint("Consider increasing max_files_per_process or "
|
errhint("Consider increasing max_files_per_process or "
|
||||||
"setting citusdb.task_executor_type to "
|
"setting citus.task_executor_type to "
|
||||||
"\"task-tracker\".")));
|
"\"task-tracker\".")));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -96,7 +96,7 @@ JobExecutorType(MultiPlan *multiPlan)
|
||||||
if (dependedJobCount > 0)
|
if (dependedJobCount > 0)
|
||||||
{
|
{
|
||||||
ereport(ERROR, (errmsg("cannot use real time executor with repartition jobs"),
|
ereport(ERROR, (errmsg("cannot use real time executor with repartition jobs"),
|
||||||
errhint("Set citusdb.task_executor_type to "
|
errhint("Set citus.task_executor_type to "
|
||||||
"\"task-tracker\".")));
|
"\"task-tracker\".")));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -119,7 +119,7 @@ JobExecutorType(MultiPlan *multiPlan)
|
||||||
if (dependedJobCount > 0)
|
if (dependedJobCount > 0)
|
||||||
{
|
{
|
||||||
ereport(ERROR, (errmsg("cannot use router executor with repartition jobs"),
|
ereport(ERROR, (errmsg("cannot use router executor with repartition jobs"),
|
||||||
errhint("Set citusdb.task_executor_type to "
|
errhint("Set citus.task_executor_type to "
|
||||||
"\"task-tracker\".")));
|
"\"task-tracker\".")));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -128,7 +128,7 @@ JobExecutorType(MultiPlan *multiPlan)
|
||||||
{
|
{
|
||||||
ereport(ERROR, (errmsg("cannot use router executor with queries that "
|
ereport(ERROR, (errmsg("cannot use router executor with queries that "
|
||||||
"hit multiple shards"),
|
"hit multiple shards"),
|
||||||
errhint("Set citusdb.task_executor_type to \"real-time\" or "
|
errhint("Set citus.task_executor_type to \"real-time\" or "
|
||||||
"\"task-tracker\".")));
|
"\"task-tracker\".")));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -138,7 +138,7 @@ JobExecutorType(MultiPlan *multiPlan)
|
||||||
if (list_length(workerDependentTaskList) > 0)
|
if (list_length(workerDependentTaskList) > 0)
|
||||||
{
|
{
|
||||||
ereport(ERROR, (errmsg("cannot use router executor with JOINs"),
|
ereport(ERROR, (errmsg("cannot use router executor with JOINs"),
|
||||||
errhint("Set citusdb.task_executor_type to \"real-time\" or "
|
errhint("Set citus.task_executor_type to \"real-time\" or "
|
||||||
"\"task-tracker\".")));
|
"\"task-tracker\".")));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -146,7 +146,7 @@ JobExecutorType(MultiPlan *multiPlan)
|
||||||
if (masterQuery != NULL && list_length(masterQuery->sortClause) > 0)
|
if (masterQuery != NULL && list_length(masterQuery->sortClause) > 0)
|
||||||
{
|
{
|
||||||
ereport(ERROR, (errmsg("cannot use router executor with ORDER BY clauses"),
|
ereport(ERROR, (errmsg("cannot use router executor with ORDER BY clauses"),
|
||||||
errhint("Set citusdb.task_executor_type to \"real-time\" or "
|
errhint("Set citus.task_executor_type to \"real-time\" or "
|
||||||
"\"task-tracker\".")));
|
"\"task-tracker\".")));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -158,7 +158,7 @@ JobExecutorType(MultiPlan *multiPlan)
|
||||||
if (masterQueryHasAggregates)
|
if (masterQueryHasAggregates)
|
||||||
{
|
{
|
||||||
ereport(ERROR, (errmsg("cannot use router executor with aggregates"),
|
ereport(ERROR, (errmsg("cannot use router executor with aggregates"),
|
||||||
errhint("Set citusdb.task_executor_type to \"real-time\" or "
|
errhint("Set citus.task_executor_type to \"real-time\" or "
|
||||||
"\"task-tracker\".")));
|
"\"task-tracker\".")));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -173,7 +173,7 @@ JobExecutorType(MultiPlan *multiPlan)
|
||||||
* Every task requires 2 FDs, one file and one connection. Some FDs are taken by
|
* Every task requires 2 FDs, one file and one connection. Some FDs are taken by
|
||||||
* the VFD pool and there is currently no way to reclaim these before opening a
|
* the VFD pool and there is currently no way to reclaim these before opening a
|
||||||
* connection. We therefore assume some FDs to be reserved for VFDs, based on
|
* connection. We therefore assume some FDs to be reserved for VFDs, based on
|
||||||
* observing a typical size of the pool on a CitusDB master.
|
* observing a typical size of the pool on a Citus master.
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
MaxMasterConnectionCount(void)
|
MaxMasterConnectionCount(void)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*-------------------------------------------------------------------------
|
/*-------------------------------------------------------------------------
|
||||||
* multi_utility.c
|
* multi_utility.c
|
||||||
* CitusDB utility hook and related functionality.
|
* Citus utility hook and related functionality.
|
||||||
*
|
*
|
||||||
* Copyright (c) 2012-2015, Citus Data, Inc.
|
* Copyright (c) 2012-2015, Citus Data, Inc.
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
|
@ -76,7 +76,7 @@ static void RangeVarCallbackForDropIndex(const RangeVar *rel, Oid relOid, Oid ol
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Utility for handling citusdb specific concerns around utility statements.
|
* Utility for handling citus specific concerns around utility statements.
|
||||||
*
|
*
|
||||||
* There's two basic types of concerns here:
|
* There's two basic types of concerns here:
|
||||||
* 1) Intercept utility statements that run after distributed query
|
* 1) Intercept utility statements that run after distributed query
|
||||||
|
@ -168,29 +168,29 @@ multi_ProcessUtility(Node *parsetree,
|
||||||
/*
|
/*
|
||||||
* Inform the user about potential caveats.
|
* Inform the user about potential caveats.
|
||||||
*
|
*
|
||||||
* To prevent failures in aborted transactions, CitusDBHasBeenLoaded() needs
|
* To prevent failures in aborted transactions, CitusHasBeenLoaded() needs
|
||||||
* to be the second condition. See RelationIdGetRelation() which is called
|
* to be the second condition. See RelationIdGetRelation() which is called
|
||||||
* by CitusDBHasBeenLoaded().
|
* by CitusHasBeenLoaded().
|
||||||
*/
|
*/
|
||||||
if (IsA(parsetree, CreatedbStmt) && CitusDBHasBeenLoaded())
|
if (IsA(parsetree, CreatedbStmt) && CitusHasBeenLoaded())
|
||||||
{
|
{
|
||||||
ereport(NOTICE, (errmsg("CitusDB partially supports CREATE DATABASE for "
|
ereport(NOTICE, (errmsg("Citus partially supports CREATE DATABASE for "
|
||||||
"distributed databases"),
|
"distributed databases"),
|
||||||
errdetail("CitusDB does not propagate CREATE DATABASE "
|
errdetail("Citus does not propagate CREATE DATABASE "
|
||||||
"command to workers"),
|
"command to workers"),
|
||||||
errhint("You can manually create a database and its "
|
errhint("You can manually create a database and its "
|
||||||
"extensions on workers.")));
|
"extensions on workers.")));
|
||||||
}
|
}
|
||||||
else if (IsA(parsetree, CreateSchemaStmt) && CitusDBHasBeenLoaded())
|
else if (IsA(parsetree, CreateSchemaStmt) && CitusHasBeenLoaded())
|
||||||
{
|
{
|
||||||
ereport(NOTICE, (errmsg("CitusDB partially supports CREATE SCHEMA "
|
ereport(NOTICE, (errmsg("Citus partially supports CREATE SCHEMA "
|
||||||
"for distributed databases"),
|
"for distributed databases"),
|
||||||
errdetail("schema usage in joins and in some UDFs "
|
errdetail("schema usage in joins and in some UDFs "
|
||||||
"provided by CitusDB are not supported yet")));
|
"provided by Citus are not supported yet")));
|
||||||
}
|
}
|
||||||
else if (IsA(parsetree, CreateRoleStmt) && CitusDBHasBeenLoaded())
|
else if (IsA(parsetree, CreateRoleStmt) && CitusHasBeenLoaded())
|
||||||
{
|
{
|
||||||
ereport(NOTICE, (errmsg("CitusDB does not support CREATE ROLE/USER "
|
ereport(NOTICE, (errmsg("Citus does not support CREATE ROLE/USER "
|
||||||
"for distributed databases"),
|
"for distributed databases"),
|
||||||
errdetail("Multiple roles are currently supported "
|
errdetail("Multiple roles are currently supported "
|
||||||
"only for local tables")));
|
"only for local tables")));
|
||||||
|
@ -204,7 +204,7 @@ multi_ProcessUtility(Node *parsetree,
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* WarnIfDropCitusExtension prints a WARNING if dropStatement includes dropping
|
* WarnIfDropCitusExtension prints a WARNING if dropStatement includes dropping
|
||||||
* citusdb extension.
|
* citus extension.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
WarnIfDropCitusExtension(DropStmt *dropStatement)
|
WarnIfDropCitusExtension(DropStmt *dropStatement)
|
||||||
|
@ -218,8 +218,8 @@ WarnIfDropCitusExtension(DropStmt *dropStatement)
|
||||||
List *objectNameList = lfirst(dropStatementObject);
|
List *objectNameList = lfirst(dropStatementObject);
|
||||||
char *objectName = NameListToString(objectNameList);
|
char *objectName = NameListToString(objectNameList);
|
||||||
|
|
||||||
/* we're only concerned with the citusdb extension */
|
/* we're only concerned with the citus extension */
|
||||||
if (strncmp("citusdb", objectName, NAMEDATALEN) == 0)
|
if (strncmp("citus", objectName, NAMEDATALEN) == 0)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* Warn the user about the possibility of invalid cache. Also, see
|
* Warn the user about the possibility of invalid cache. Also, see
|
||||||
|
@ -296,7 +296,7 @@ VerifyTransmitStmt(CopyStmt *copyStatement)
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* ProcessCopyStmt handles CitusDB specific concerns for COPY like supporting
|
* ProcessCopyStmt handles Citus specific concerns for COPY like supporting
|
||||||
* COPYing from distributed tables and preventing unsupported actions.
|
* COPYing from distributed tables and preventing unsupported actions.
|
||||||
*/
|
*/
|
||||||
static Node *
|
static Node *
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*-------------------------------------------------------------------------
|
/*-------------------------------------------------------------------------
|
||||||
*
|
*
|
||||||
* multi_explain.c
|
* multi_explain.c
|
||||||
* CitusDB explain support.
|
* Citus explain support.
|
||||||
*
|
*
|
||||||
* Copyright (c) 2012-2015, Citus Data, Inc.
|
* Copyright (c) 2012-2015, Citus Data, Inc.
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
|
|
|
@ -175,7 +175,7 @@ FixedJoinOrderList(FromExpr *fromExpr, List *tableEntryList)
|
||||||
"query"),
|
"query"),
|
||||||
errdetail("Cannot perform outer joins with broadcast "
|
errdetail("Cannot perform outer joins with broadcast "
|
||||||
"joins of more than 1 shard"),
|
"joins of more than 1 shard"),
|
||||||
errhint("Set citusdb.large_table_shard_count to 1")));
|
errhint("Set citus.large_table_shard_count to 1")));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (nextJoinNode->joinRuleType == LOCAL_PARTITION_JOIN)
|
else if (nextJoinNode->joinRuleType == LOCAL_PARTITION_JOIN)
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*-------------------------------------------------------------------------
|
/*-------------------------------------------------------------------------
|
||||||
*
|
*
|
||||||
* multi_planner.c
|
* multi_planner.c
|
||||||
* General CitusDB planner code.
|
* General Citus planner code.
|
||||||
*
|
*
|
||||||
* Copyright (c) 2012-2015, Citus Data, Inc.
|
* Copyright (c) 2012-2015, Citus Data, Inc.
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
|
@ -45,7 +45,7 @@ multi_planner(Query *parse, int cursorOptions, ParamListInfo boundParams)
|
||||||
PlannedStmt *result = NULL;
|
PlannedStmt *result = NULL;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* First call into standard planner. This is required because the CitusDB
|
* First call into standard planner. This is required because the Citus
|
||||||
* planner relies on parse tree transformations made by postgres' planner.
|
* planner relies on parse tree transformations made by postgres' planner.
|
||||||
*/
|
*/
|
||||||
result = standard_planner(parse, cursorOptions, boundParams);
|
result = standard_planner(parse, cursorOptions, boundParams);
|
||||||
|
@ -90,7 +90,7 @@ CreatePhysicalPlan(Query *parse)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This check is here to make it likely that all node types used in
|
* This check is here to make it likely that all node types used in
|
||||||
* CitusDB are dumpable. Explain can dump logical and physical plans
|
* Citus are dumpable. Explain can dump logical and physical plans
|
||||||
* using the extended outfuncs infrastructure, but it's infeasible to
|
* using the extended outfuncs infrastructure, but it's infeasible to
|
||||||
* test most plans. MultiQueryContainerNode always serializes the
|
* test most plans. MultiQueryContainerNode always serializes the
|
||||||
* physical plan, so there's no need to check that separately.
|
* physical plan, so there's no need to check that separately.
|
||||||
|
@ -132,7 +132,7 @@ HasCitusToplevelNode(PlannedStmt *result)
|
||||||
* yet. Directly return false, part of the required infrastructure for
|
* yet. Directly return false, part of the required infrastructure for
|
||||||
* further checks might not be present.
|
* further checks might not be present.
|
||||||
*/
|
*/
|
||||||
if (!CitusDBHasBeenLoaded())
|
if (!CitusHasBeenLoaded())
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -259,7 +259,7 @@ GetMultiPlanString(PlannedStmt *result)
|
||||||
if (list_length(fauxFuncExpr->args) != 1)
|
if (list_length(fauxFuncExpr->args) != 1)
|
||||||
{
|
{
|
||||||
ereport(ERROR, (errmsg("unexpected number of function arguments to "
|
ereport(ERROR, (errmsg("unexpected number of function arguments to "
|
||||||
"citusdb_extradata_container")));
|
"citus_extradata_container")));
|
||||||
}
|
}
|
||||||
|
|
||||||
multiPlanData = (Const *) linitial(fauxFuncExpr->args);
|
multiPlanData = (Const *) linitial(fauxFuncExpr->args);
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*-------------------------------------------------------------------------
|
/*-------------------------------------------------------------------------
|
||||||
*
|
*
|
||||||
* shared_library_init.c
|
* shared_library_init.c
|
||||||
* Initialize CitusDB extension
|
* Initialize Citus extension
|
||||||
*
|
*
|
||||||
* Copyright (c) 2012-2015, Citus Data, Inc.
|
* Copyright (c) 2012-2015, Citus Data, Inc.
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
|
@ -74,8 +74,8 @@ _PG_init(void)
|
||||||
{
|
{
|
||||||
if (!process_shared_preload_libraries_in_progress)
|
if (!process_shared_preload_libraries_in_progress)
|
||||||
{
|
{
|
||||||
ereport(ERROR, (errmsg("CitusDB can only be loaded via shared_preload_libraries"),
|
ereport(ERROR, (errmsg("Citus can only be loaded via shared_preload_libraries"),
|
||||||
errhint("Add citusdb to shared_preload_libraries.")));
|
errhint("Add citus to shared_preload_libraries.")));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -95,8 +95,8 @@ _PG_init(void)
|
||||||
ExecutorEnd_hook != NULL ||
|
ExecutorEnd_hook != NULL ||
|
||||||
ProcessUtility_hook != NULL)
|
ProcessUtility_hook != NULL)
|
||||||
{
|
{
|
||||||
ereport(ERROR, (errmsg("CitusDB has to be loaded first"),
|
ereport(ERROR, (errmsg("Citus has to be loaded first"),
|
||||||
errhint("Place citusdb at the beginning of "
|
errhint("Place citus at the beginning of "
|
||||||
"shared_preload_libraries.")));
|
"shared_preload_libraries.")));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -107,7 +107,7 @@ _PG_init(void)
|
||||||
CreateRequiredDirectories();
|
CreateRequiredDirectories();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Register CitusDB configuration variables. Do so before intercepting
|
* Register Citus configuration variables. Do so before intercepting
|
||||||
* hooks or calling initialization functions, in case we want to do the
|
* hooks or calling initialization functions, in case we want to do the
|
||||||
* latter in a configuration dependent manner.
|
* latter in a configuration dependent manner.
|
||||||
*/
|
*/
|
||||||
|
@ -137,7 +137,7 @@ _PG_init(void)
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* CreateRequiredDirectories - Create directories required for CitusDB to
|
* CreateRequiredDirectories - Create directories required for Citus to
|
||||||
* function.
|
* function.
|
||||||
*
|
*
|
||||||
* These used to be created by initdb, but that's not possible anymore.
|
* These used to be created by initdb, but that's not possible anymore.
|
||||||
|
@ -166,12 +166,12 @@ CreateRequiredDirectories(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Register CitusDB configuration variables. */
|
/* Register Citus configuration variables. */
|
||||||
static void
|
static void
|
||||||
RegisterCitusConfigVariables(void)
|
RegisterCitusConfigVariables(void)
|
||||||
{
|
{
|
||||||
DefineCustomStringVariable(
|
DefineCustomStringVariable(
|
||||||
"citusdb.worker_list_file",
|
"citus.worker_list_file",
|
||||||
gettext_noop("Sets the server's \"worker_list\" configuration file."),
|
gettext_noop("Sets the server's \"worker_list\" configuration file."),
|
||||||
NULL,
|
NULL,
|
||||||
&WorkerListFileName,
|
&WorkerListFileName,
|
||||||
|
@ -182,7 +182,7 @@ RegisterCitusConfigVariables(void)
|
||||||
NormalizeWorkerListPath();
|
NormalizeWorkerListPath();
|
||||||
|
|
||||||
DefineCustomBoolVariable(
|
DefineCustomBoolVariable(
|
||||||
"citusdb.binary_master_copy_format",
|
"citus.binary_master_copy_format",
|
||||||
gettext_noop("Use the binary master copy format."),
|
gettext_noop("Use the binary master copy format."),
|
||||||
gettext_noop("When enabled, data is copied from workers to the master "
|
gettext_noop("When enabled, data is copied from workers to the master "
|
||||||
"in PostgreSQL's binary serialization format."),
|
"in PostgreSQL's binary serialization format."),
|
||||||
|
@ -193,7 +193,7 @@ RegisterCitusConfigVariables(void)
|
||||||
NULL, NULL, NULL);
|
NULL, NULL, NULL);
|
||||||
|
|
||||||
DefineCustomBoolVariable(
|
DefineCustomBoolVariable(
|
||||||
"citusdb.binary_worker_copy_format",
|
"citus.binary_worker_copy_format",
|
||||||
gettext_noop("Use the binary worker copy format."),
|
gettext_noop("Use the binary worker copy format."),
|
||||||
gettext_noop("When enabled, data is copied from workers to workers "
|
gettext_noop("When enabled, data is copied from workers to workers "
|
||||||
"in PostgreSQL's binary serialization format when "
|
"in PostgreSQL's binary serialization format when "
|
||||||
|
@ -205,7 +205,7 @@ RegisterCitusConfigVariables(void)
|
||||||
NULL, NULL, NULL);
|
NULL, NULL, NULL);
|
||||||
|
|
||||||
DefineCustomBoolVariable(
|
DefineCustomBoolVariable(
|
||||||
"citusdb.expire_cached_shards",
|
"citus.expire_cached_shards",
|
||||||
gettext_noop("Enables shard cache expiration if a shard's size on disk has changed. "),
|
gettext_noop("Enables shard cache expiration if a shard's size on disk has changed. "),
|
||||||
gettext_noop("When appending to an existing shard, old data may still be cached on "
|
gettext_noop("When appending to an existing shard, old data may still be cached on "
|
||||||
"other workers. This configuration entry activates automatic "
|
"other workers. This configuration entry activates automatic "
|
||||||
|
@ -217,7 +217,7 @@ RegisterCitusConfigVariables(void)
|
||||||
NULL, NULL, NULL);
|
NULL, NULL, NULL);
|
||||||
|
|
||||||
DefineCustomBoolVariable(
|
DefineCustomBoolVariable(
|
||||||
"citusdb.subquery_pushdown",
|
"citus.subquery_pushdown",
|
||||||
gettext_noop("Enables supported subquery pushdown to workers."),
|
gettext_noop("Enables supported subquery pushdown to workers."),
|
||||||
NULL,
|
NULL,
|
||||||
&SubqueryPushdown,
|
&SubqueryPushdown,
|
||||||
|
@ -227,7 +227,7 @@ RegisterCitusConfigVariables(void)
|
||||||
NULL, NULL, NULL);
|
NULL, NULL, NULL);
|
||||||
|
|
||||||
DefineCustomBoolVariable(
|
DefineCustomBoolVariable(
|
||||||
"citusdb.log_multi_join_order",
|
"citus.log_multi_join_order",
|
||||||
gettext_noop("Logs the distributed join order to the server log."),
|
gettext_noop("Logs the distributed join order to the server log."),
|
||||||
gettext_noop("We use this private configuration entry as a debugging aid. "
|
gettext_noop("We use this private configuration entry as a debugging aid. "
|
||||||
"If enabled, we print the distributed join order."),
|
"If enabled, we print the distributed join order."),
|
||||||
|
@ -238,7 +238,7 @@ RegisterCitusConfigVariables(void)
|
||||||
NULL, NULL, NULL);
|
NULL, NULL, NULL);
|
||||||
|
|
||||||
DefineCustomBoolVariable(
|
DefineCustomBoolVariable(
|
||||||
"citusdb.explain_multi_logical_plan",
|
"citus.explain_multi_logical_plan",
|
||||||
gettext_noop("Enables Explain to print out distributed logical plans."),
|
gettext_noop("Enables Explain to print out distributed logical plans."),
|
||||||
gettext_noop("We use this private configuration entry as a debugging aid. "
|
gettext_noop("We use this private configuration entry as a debugging aid. "
|
||||||
"If enabled, the Explain command prints out the optimized "
|
"If enabled, the Explain command prints out the optimized "
|
||||||
|
@ -250,7 +250,7 @@ RegisterCitusConfigVariables(void)
|
||||||
NULL, NULL, NULL);
|
NULL, NULL, NULL);
|
||||||
|
|
||||||
DefineCustomBoolVariable(
|
DefineCustomBoolVariable(
|
||||||
"citusdb.explain_multi_physical_plan",
|
"citus.explain_multi_physical_plan",
|
||||||
gettext_noop("Enables Explain to print out distributed physical plans."),
|
gettext_noop("Enables Explain to print out distributed physical plans."),
|
||||||
gettext_noop("We use this private configuration entry as a debugging aid. "
|
gettext_noop("We use this private configuration entry as a debugging aid. "
|
||||||
"If enabled, the Explain command prints out the physical "
|
"If enabled, the Explain command prints out the physical "
|
||||||
|
@ -262,7 +262,7 @@ RegisterCitusConfigVariables(void)
|
||||||
NULL, NULL, NULL);
|
NULL, NULL, NULL);
|
||||||
|
|
||||||
DefineCustomBoolVariable(
|
DefineCustomBoolVariable(
|
||||||
"citusdb.all_modifications_commutative",
|
"citus.all_modifications_commutative",
|
||||||
gettext_noop("Bypasses commutativity checks when enabled"),
|
gettext_noop("Bypasses commutativity checks when enabled"),
|
||||||
NULL,
|
NULL,
|
||||||
&AllModificationsCommutative,
|
&AllModificationsCommutative,
|
||||||
|
@ -272,7 +272,7 @@ RegisterCitusConfigVariables(void)
|
||||||
NULL, NULL, NULL);
|
NULL, NULL, NULL);
|
||||||
|
|
||||||
DefineCustomIntVariable(
|
DefineCustomIntVariable(
|
||||||
"citusdb.shard_replication_factor",
|
"citus.shard_replication_factor",
|
||||||
gettext_noop("Sets the replication factor for shards."),
|
gettext_noop("Sets the replication factor for shards."),
|
||||||
gettext_noop("Shards are replicated across nodes according to this "
|
gettext_noop("Shards are replicated across nodes according to this "
|
||||||
"replication factor. Note that shards read this "
|
"replication factor. Note that shards read this "
|
||||||
|
@ -285,7 +285,7 @@ RegisterCitusConfigVariables(void)
|
||||||
NULL, NULL, NULL);
|
NULL, NULL, NULL);
|
||||||
|
|
||||||
DefineCustomIntVariable(
|
DefineCustomIntVariable(
|
||||||
"citusdb.shard_max_size",
|
"citus.shard_max_size",
|
||||||
gettext_noop("Sets the maximum size a shard will grow before it gets split."),
|
gettext_noop("Sets the maximum size a shard will grow before it gets split."),
|
||||||
gettext_noop("Shards store table and file data. When the source "
|
gettext_noop("Shards store table and file data. When the source "
|
||||||
"file's size for one shard exceeds this configuration "
|
"file's size for one shard exceeds this configuration "
|
||||||
|
@ -300,7 +300,7 @@ RegisterCitusConfigVariables(void)
|
||||||
NULL, NULL, NULL);
|
NULL, NULL, NULL);
|
||||||
|
|
||||||
DefineCustomIntVariable(
|
DefineCustomIntVariable(
|
||||||
"citusdb.max_worker_nodes_tracked",
|
"citus.max_worker_nodes_tracked",
|
||||||
gettext_noop("Sets the maximum number of worker nodes that are tracked."),
|
gettext_noop("Sets the maximum number of worker nodes that are tracked."),
|
||||||
gettext_noop("Worker nodes' network locations, their membership and "
|
gettext_noop("Worker nodes' network locations, their membership and "
|
||||||
"health status are tracked in a shared hash table on "
|
"health status are tracked in a shared hash table on "
|
||||||
|
@ -314,7 +314,7 @@ RegisterCitusConfigVariables(void)
|
||||||
NULL, NULL, NULL);
|
NULL, NULL, NULL);
|
||||||
|
|
||||||
DefineCustomIntVariable(
|
DefineCustomIntVariable(
|
||||||
"citusdb.remote_task_check_interval",
|
"citus.remote_task_check_interval",
|
||||||
gettext_noop("Sets the frequency at which we check job statuses."),
|
gettext_noop("Sets the frequency at which we check job statuses."),
|
||||||
gettext_noop("The master node assigns tasks to workers nodes, and "
|
gettext_noop("The master node assigns tasks to workers nodes, and "
|
||||||
"then regularly checks with them about each task's "
|
"then regularly checks with them about each task's "
|
||||||
|
@ -327,7 +327,7 @@ RegisterCitusConfigVariables(void)
|
||||||
NULL, NULL, NULL);
|
NULL, NULL, NULL);
|
||||||
|
|
||||||
DefineCustomIntVariable(
|
DefineCustomIntVariable(
|
||||||
"citusdb.task_tracker_delay",
|
"citus.task_tracker_delay",
|
||||||
gettext_noop("Task tracker sleep time between task management rounds."),
|
gettext_noop("Task tracker sleep time between task management rounds."),
|
||||||
gettext_noop("The task tracker process wakes up regularly, walks over "
|
gettext_noop("The task tracker process wakes up regularly, walks over "
|
||||||
"all tasks assigned to it, and schedules and executes these "
|
"all tasks assigned to it, and schedules and executes these "
|
||||||
|
@ -341,7 +341,7 @@ RegisterCitusConfigVariables(void)
|
||||||
NULL, NULL, NULL);
|
NULL, NULL, NULL);
|
||||||
|
|
||||||
DefineCustomIntVariable(
|
DefineCustomIntVariable(
|
||||||
"citusdb.max_assign_task_batch_size",
|
"citus.max_assign_task_batch_size",
|
||||||
gettext_noop("Sets the maximum number of tasks to assign per round."),
|
gettext_noop("Sets the maximum number of tasks to assign per round."),
|
||||||
gettext_noop("The master node synchronously assigns tasks to workers in "
|
gettext_noop("The master node synchronously assigns tasks to workers in "
|
||||||
"batches. Bigger batches allow for faster task assignment, "
|
"batches. Bigger batches allow for faster task assignment, "
|
||||||
|
@ -355,7 +355,7 @@ RegisterCitusConfigVariables(void)
|
||||||
NULL, NULL, NULL);
|
NULL, NULL, NULL);
|
||||||
|
|
||||||
DefineCustomIntVariable(
|
DefineCustomIntVariable(
|
||||||
"citusdb.max_tracked_tasks_per_node",
|
"citus.max_tracked_tasks_per_node",
|
||||||
gettext_noop("Sets the maximum number of tracked tasks per node."),
|
gettext_noop("Sets the maximum number of tracked tasks per node."),
|
||||||
gettext_noop("The task tracker processes keeps all assigned tasks in "
|
gettext_noop("The task tracker processes keeps all assigned tasks in "
|
||||||
"a shared hash table, and schedules and executes these "
|
"a shared hash table, and schedules and executes these "
|
||||||
|
@ -369,7 +369,7 @@ RegisterCitusConfigVariables(void)
|
||||||
NULL, NULL, NULL);
|
NULL, NULL, NULL);
|
||||||
|
|
||||||
DefineCustomIntVariable(
|
DefineCustomIntVariable(
|
||||||
"citusdb.max_running_tasks_per_node",
|
"citus.max_running_tasks_per_node",
|
||||||
gettext_noop("Sets the maximum number of tasks to run concurrently per node."),
|
gettext_noop("Sets the maximum number of tasks to run concurrently per node."),
|
||||||
gettext_noop("The task tracker process schedules and executes the tasks "
|
gettext_noop("The task tracker process schedules and executes the tasks "
|
||||||
"assigned to it as appropriate. This configuration value "
|
"assigned to it as appropriate. This configuration value "
|
||||||
|
@ -382,7 +382,7 @@ RegisterCitusConfigVariables(void)
|
||||||
NULL, NULL, NULL);
|
NULL, NULL, NULL);
|
||||||
|
|
||||||
DefineCustomIntVariable(
|
DefineCustomIntVariable(
|
||||||
"citusdb.partition_buffer_size",
|
"citus.partition_buffer_size",
|
||||||
gettext_noop("Sets the buffer size to use for partition operations."),
|
gettext_noop("Sets the buffer size to use for partition operations."),
|
||||||
gettext_noop("Worker nodes allow for table data to be repartitioned "
|
gettext_noop("Worker nodes allow for table data to be repartitioned "
|
||||||
"into multiple text files, much like Hadoop's Map "
|
"into multiple text files, much like Hadoop's Map "
|
||||||
|
@ -396,7 +396,7 @@ RegisterCitusConfigVariables(void)
|
||||||
NULL, NULL, NULL);
|
NULL, NULL, NULL);
|
||||||
|
|
||||||
DefineCustomIntVariable(
|
DefineCustomIntVariable(
|
||||||
"citusdb.large_table_shard_count",
|
"citus.large_table_shard_count",
|
||||||
gettext_noop("The shard count threshold over which a table is considered large."),
|
gettext_noop("The shard count threshold over which a table is considered large."),
|
||||||
gettext_noop("A distributed table is considered to be large if it has "
|
gettext_noop("A distributed table is considered to be large if it has "
|
||||||
"more shards than the value specified here. This largeness "
|
"more shards than the value specified here. This largeness "
|
||||||
|
@ -409,7 +409,7 @@ RegisterCitusConfigVariables(void)
|
||||||
NULL, NULL, NULL);
|
NULL, NULL, NULL);
|
||||||
|
|
||||||
DefineCustomIntVariable(
|
DefineCustomIntVariable(
|
||||||
"citusdb.limit_clause_row_fetch_count",
|
"citus.limit_clause_row_fetch_count",
|
||||||
gettext_noop("Number of rows to fetch per task for limit clause optimization."),
|
gettext_noop("Number of rows to fetch per task for limit clause optimization."),
|
||||||
gettext_noop("Select queries get partitioned and executed as smaller "
|
gettext_noop("Select queries get partitioned and executed as smaller "
|
||||||
"tasks. In some cases, select queries with limit clauses "
|
"tasks. In some cases, select queries with limit clauses "
|
||||||
|
@ -424,7 +424,7 @@ RegisterCitusConfigVariables(void)
|
||||||
NULL, NULL, NULL);
|
NULL, NULL, NULL);
|
||||||
|
|
||||||
DefineCustomRealVariable(
|
DefineCustomRealVariable(
|
||||||
"citusdb.count_distinct_error_rate",
|
"citus.count_distinct_error_rate",
|
||||||
gettext_noop("Desired error rate when calculating count(distinct) "
|
gettext_noop("Desired error rate when calculating count(distinct) "
|
||||||
"approximates using the postgresql-hll extension. "
|
"approximates using the postgresql-hll extension. "
|
||||||
"0.0 disables approximations for count(distinct); 1.0 "
|
"0.0 disables approximations for count(distinct); 1.0 "
|
||||||
|
@ -437,7 +437,7 @@ RegisterCitusConfigVariables(void)
|
||||||
NULL, NULL, NULL);
|
NULL, NULL, NULL);
|
||||||
|
|
||||||
DefineCustomEnumVariable(
|
DefineCustomEnumVariable(
|
||||||
"citusdb.task_assignment_policy",
|
"citus.task_assignment_policy",
|
||||||
gettext_noop("Sets the policy to use when assigning tasks to worker nodes."),
|
gettext_noop("Sets the policy to use when assigning tasks to worker nodes."),
|
||||||
gettext_noop("The master node assigns tasks to worker nodes based on shard "
|
gettext_noop("The master node assigns tasks to worker nodes based on shard "
|
||||||
"locations. This configuration value specifies the policy to "
|
"locations. This configuration value specifies the policy to "
|
||||||
|
@ -454,7 +454,7 @@ RegisterCitusConfigVariables(void)
|
||||||
NULL, NULL, NULL);
|
NULL, NULL, NULL);
|
||||||
|
|
||||||
DefineCustomEnumVariable(
|
DefineCustomEnumVariable(
|
||||||
"citusdb.task_executor_type",
|
"citus.task_executor_type",
|
||||||
gettext_noop("Sets the executor type to be used for distributed queries."),
|
gettext_noop("Sets the executor type to be used for distributed queries."),
|
||||||
gettext_noop("The master node chooses between three different executor types "
|
gettext_noop("The master node chooses between three different executor types "
|
||||||
"when executing a distributed query. The router executor is "
|
"when executing a distributed query. The router executor is "
|
||||||
|
@ -472,7 +472,7 @@ RegisterCitusConfigVariables(void)
|
||||||
NULL, NULL, NULL);
|
NULL, NULL, NULL);
|
||||||
|
|
||||||
DefineCustomEnumVariable(
|
DefineCustomEnumVariable(
|
||||||
"citusdb.shard_placement_policy",
|
"citus.shard_placement_policy",
|
||||||
gettext_noop("Sets the policy to use when choosing nodes for shard placement."),
|
gettext_noop("Sets the policy to use when choosing nodes for shard placement."),
|
||||||
gettext_noop("The master node chooses which worker nodes to place new shards "
|
gettext_noop("The master node chooses which worker nodes to place new shards "
|
||||||
"on. This configuration value specifies the policy to use when "
|
"on. This configuration value specifies the policy to use when "
|
||||||
|
@ -486,8 +486,8 @@ RegisterCitusConfigVariables(void)
|
||||||
0,
|
0,
|
||||||
NULL, NULL, NULL);
|
NULL, NULL, NULL);
|
||||||
|
|
||||||
/* warn about config items in the citusdb namespace that are not registered above */
|
/* warn about config items in the citus namespace that are not registered above */
|
||||||
EmitWarningsOnPlaceholders("citusdb");
|
EmitWarningsOnPlaceholders("citus");
|
||||||
/* Also warn about citus namespace, as that's a very likely misspelling */
|
/* Also warn about citus namespace, as that's a very likely misspelling */
|
||||||
EmitWarningsOnPlaceholders("citus");
|
EmitWarningsOnPlaceholders("citus");
|
||||||
}
|
}
|
||||||
|
@ -495,7 +495,7 @@ RegisterCitusConfigVariables(void)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* NormalizeWorkerListPath converts the path configured via
|
* NormalizeWorkerListPath converts the path configured via
|
||||||
* citusdb.worker_list_file into an absolute path, falling back to the default
|
* citus.worker_list_file into an absolute path, falling back to the default
|
||||||
* value if necessary. The previous value of the config variable is
|
* value if necessary. The previous value of the config variable is
|
||||||
* overwritten with the normalized value.
|
* overwritten with the normalized value.
|
||||||
*
|
*
|
||||||
|
@ -525,11 +525,11 @@ NormalizeWorkerListPath(void)
|
||||||
ereport(FATAL, (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
|
ereport(FATAL, (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
|
||||||
errmsg("%s does not know where to find the \"worker_list_file\" "
|
errmsg("%s does not know where to find the \"worker_list_file\" "
|
||||||
"configuration file.\n"
|
"configuration file.\n"
|
||||||
"This can be specified as \"citusdb.worker_list_file\" in "
|
"This can be specified as \"citus.worker_list_file\" in "
|
||||||
"\"%s\", or by the -D invocation option, or by the PGDATA "
|
"\"%s\", or by the -D invocation option, or by the PGDATA "
|
||||||
"environment variable.\n", progname, ConfigFileName)));
|
"environment variable.\n", progname, ConfigFileName)));
|
||||||
}
|
}
|
||||||
|
|
||||||
SetConfigOption("citusdb.worker_list_file", absoluteFileName, PGC_POSTMASTER, PGC_S_OVERRIDE);
|
SetConfigOption("citus.worker_list_file", absoluteFileName, PGC_POSTMASTER, PGC_S_OVERRIDE);
|
||||||
free(absoluteFileName);
|
free(absoluteFileName);
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
*
|
*
|
||||||
* test/src/connection_cache.c
|
* test/src/connection_cache.c
|
||||||
*
|
*
|
||||||
* This file contains functions to exercise CitusDB's connection hash
|
* This file contains functions to exercise Citus's connection hash
|
||||||
* functionality for purposes of unit testing.
|
* functionality for purposes of unit testing.
|
||||||
*
|
*
|
||||||
* Copyright (c) 2014-2015, Citus Data, Inc.
|
* Copyright (c) 2014-2015, Citus Data, Inc.
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
* test/src/create_shards.c
|
* test/src/create_shards.c
|
||||||
*
|
*
|
||||||
* This file contains functions to exercise shard creation functionality
|
* This file contains functions to exercise shard creation functionality
|
||||||
* within CitusDB.
|
* within Citus.
|
||||||
*
|
*
|
||||||
* Copyright (c) 2014-2015, Citus Data, Inc.
|
* Copyright (c) 2014-2015, Citus Data, Inc.
|
||||||
*
|
*
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
* test/src/distribution_metadata.c
|
* test/src/distribution_metadata.c
|
||||||
*
|
*
|
||||||
* This file contains functions to exercise distributed table metadata
|
* This file contains functions to exercise distributed table metadata
|
||||||
* functionality within CitusDB.
|
* functionality within Citus.
|
||||||
*
|
*
|
||||||
* Copyright (c) 2014-2015, Citus Data, Inc.
|
* Copyright (c) 2014-2015, Citus Data, Inc.
|
||||||
*
|
*
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
* test/src/generate_ddl_commands.c
|
* test/src/generate_ddl_commands.c
|
||||||
*
|
*
|
||||||
* This file contains functions to exercise DDL generation functionality
|
* This file contains functions to exercise DDL generation functionality
|
||||||
* within CitusDB.
|
* within Citus.
|
||||||
*
|
*
|
||||||
* Copyright (c) 2014-2015, Citus Data, Inc.
|
* Copyright (c) 2014-2015, Citus Data, Inc.
|
||||||
*
|
*
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
* test/src/create_shards.c
|
* test/src/create_shards.c
|
||||||
*
|
*
|
||||||
* This file contains functions to exercise shard creation functionality
|
* This file contains functions to exercise shard creation functionality
|
||||||
* within CitusDB.
|
* within Citus.
|
||||||
*
|
*
|
||||||
* Copyright (c) 2014-2015, Citus Data, Inc.
|
* Copyright (c) 2014-2015, Citus Data, Inc.
|
||||||
*
|
*
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
*
|
*
|
||||||
* test/src/test_helper_functions.c
|
* test/src/test_helper_functions.c
|
||||||
*
|
*
|
||||||
* This file contains helper functions used in many CitusDB tests.
|
* This file contains helper functions used in many Citus tests.
|
||||||
*
|
*
|
||||||
* Copyright (c) 2014-2015, Citus Data, Inc.
|
* Copyright (c) 2014-2015, Citus Data, Inc.
|
||||||
*
|
*
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
|
|
||||||
|
|
||||||
/* exports for SQL callable functions */
|
/* exports for SQL callable functions */
|
||||||
PG_FUNCTION_INFO_V1(citusdb_extradata_container);
|
PG_FUNCTION_INFO_V1(citus_extradata_container);
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -189,7 +189,7 @@ ExtractRangeTblExtraData(RangeTblEntry *rte, CitusRTEKind *rteKind,
|
||||||
if (list_length(fauxFuncExpr->args) != 4)
|
if (list_length(fauxFuncExpr->args) != 4)
|
||||||
{
|
{
|
||||||
ereport(ERROR, (errmsg("unexpected number of function arguments to "
|
ereport(ERROR, (errmsg("unexpected number of function arguments to "
|
||||||
"citusdb_extradata_container")));
|
"citus_extradata_container")));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -290,13 +290,13 @@ GetRangeTblKind(RangeTblEntry *rte)
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* citusdb_extradata_container is a placeholder function to store information
|
* citus_extradata_container is a placeholder function to store information
|
||||||
* needed by CitusDB in plain postgres node trees. Executor and other hooks
|
* needed by Citus in plain postgres node trees. Executor and other hooks
|
||||||
* should always intercept statements containing calls to this function. It's
|
* should always intercept statements containing calls to this function. It's
|
||||||
* not actually SQL callable by the user because of an INTERNAL argument.
|
* not actually SQL callable by the user because of an INTERNAL argument.
|
||||||
*/
|
*/
|
||||||
Datum
|
Datum
|
||||||
citusdb_extradata_container(PG_FUNCTION_ARGS)
|
citus_extradata_container(PG_FUNCTION_ARGS)
|
||||||
{
|
{
|
||||||
ereport(ERROR, (errmsg("not supposed to get here, did you cheat?")));
|
ereport(ERROR, (errmsg("not supposed to get here, did you cheat?")));
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*-------------------------------------------------------------------------
|
/*-------------------------------------------------------------------------
|
||||||
*
|
*
|
||||||
* citus_outfuncs.c
|
* citus_outfuncs.c
|
||||||
* Output functions for CitusDB tree nodes.
|
* Output functions for Citus tree nodes.
|
||||||
*
|
*
|
||||||
* Portions Copyright (c) 1996-2014, PostgreSQL Global Development Group
|
* Portions Copyright (c) 1996-2014, PostgreSQL Global Development Group
|
||||||
* Portions Copyright (c) 1994, Regents of the University of California
|
* Portions Copyright (c) 1994, Regents of the University of California
|
||||||
|
@ -9,7 +9,7 @@
|
||||||
*
|
*
|
||||||
* NOTES
|
* NOTES
|
||||||
* This is a wrapper around postgres' nodeToString() that additionally
|
* This is a wrapper around postgres' nodeToString() that additionally
|
||||||
* supports CitusDB node types.
|
* supports Citus node types.
|
||||||
*
|
*
|
||||||
* Keep as closely aligned with the upstream version as possible.
|
* Keep as closely aligned with the upstream version as possible.
|
||||||
*
|
*
|
||||||
|
@ -220,7 +220,7 @@ _outDatum(StringInfo str, Datum value, int typlen, bool typbyval)
|
||||||
|
|
||||||
|
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
* Output routines for CitusDB node types
|
* Output routines for Citus node types
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*-------------------------------------------------------------------------
|
/*-------------------------------------------------------------------------
|
||||||
*
|
*
|
||||||
* citus_readfuncs.c
|
* citus_readfuncs.c
|
||||||
* CitusDB adapted reader functions for Citus & Postgres tree nodes
|
* Citus adapted reader functions for Citus & Postgres tree nodes
|
||||||
*
|
*
|
||||||
* Portions Copyright (c) 1996-2014, PostgreSQL Global Development Group
|
* Portions Copyright (c) 1996-2014, PostgreSQL Global Development Group
|
||||||
* Portions Copyright (c) 1994, Regents of the University of California
|
* Portions Copyright (c) 1994, Regents of the University of California
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*-------------------------------------------------------------------------
|
/*-------------------------------------------------------------------------
|
||||||
*
|
*
|
||||||
* citus_readfuncs.c
|
* citus_readfuncs.c
|
||||||
* CitusDB adapted reader functions for Citus & Postgres tree nodes
|
* Citus adapted reader functions for Citus & Postgres tree nodes
|
||||||
*
|
*
|
||||||
* Portions Copyright (c) 1996-2014, PostgreSQL Global Development Group
|
* Portions Copyright (c) 1996-2014, PostgreSQL Global Development Group
|
||||||
* Portions Copyright (c) 1994, Regents of the University of California
|
* Portions Copyright (c) 1994, Regents of the University of California
|
||||||
|
|
|
@ -249,7 +249,7 @@ CreateNodeConnectionHash(void)
|
||||||
info.hcxt = CacheMemoryContext;
|
info.hcxt = CacheMemoryContext;
|
||||||
hashFlags = (HASH_ELEM | HASH_FUNCTION | HASH_CONTEXT);
|
hashFlags = (HASH_ELEM | HASH_FUNCTION | HASH_CONTEXT);
|
||||||
|
|
||||||
nodeConnectionHash = hash_create("citusdb connection cache", 32, &info, hashFlags);
|
nodeConnectionHash = hash_create("citus connection cache", 32, &info, hashFlags);
|
||||||
|
|
||||||
return nodeConnectionHash;
|
return nodeConnectionHash;
|
||||||
}
|
}
|
||||||
|
@ -257,7 +257,7 @@ CreateNodeConnectionHash(void)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* ConnectToNode opens a connection to a remote PostgreSQL server. The function
|
* ConnectToNode opens a connection to a remote PostgreSQL server. The function
|
||||||
* configures the connection's fallback application name to 'citusdb' and sets
|
* configures the connection's fallback application name to 'citus' and sets
|
||||||
* the remote encoding to match the local one. This function requires that the
|
* the remote encoding to match the local one. This function requires that the
|
||||||
* port be specified as a string for easier use with libpq functions.
|
* port be specified as a string for easier use with libpq functions.
|
||||||
*
|
*
|
||||||
|
@ -277,7 +277,7 @@ ConnectToNode(char *nodeName, char *nodePort)
|
||||||
"client_encoding", "connect_timeout", "dbname", NULL
|
"client_encoding", "connect_timeout", "dbname", NULL
|
||||||
};
|
};
|
||||||
const char *valueArray[] = {
|
const char *valueArray[] = {
|
||||||
nodeName, nodePort, "citusdb", clientEncoding,
|
nodeName, nodePort, "citus", clientEncoding,
|
||||||
CLIENT_CONNECT_TIMEOUT_SECONDS, dbname, NULL
|
CLIENT_CONNECT_TIMEOUT_SECONDS, dbname, NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -77,7 +77,7 @@ IsDistributedTable(Oid relationId)
|
||||||
* yet. As we can't do lookups in nonexistent tables, directly return
|
* yet. As we can't do lookups in nonexistent tables, directly return
|
||||||
* false.
|
* false.
|
||||||
*/
|
*/
|
||||||
if (!CitusDBHasBeenLoaded())
|
if (!CitusHasBeenLoaded())
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -155,7 +155,7 @@ DistributedTableCacheEntry(Oid distributedRelationId)
|
||||||
* yet. As we can't do lookups in nonexistent tables, directly return NULL
|
* yet. As we can't do lookups in nonexistent tables, directly return NULL
|
||||||
* here.
|
* here.
|
||||||
*/
|
*/
|
||||||
if (!CitusDBHasBeenLoaded())
|
if (!CitusHasBeenLoaded())
|
||||||
{
|
{
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -292,7 +292,7 @@ LookupDistTableCacheEntry(Oid relationId)
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* CitusDBHasBeenLoaded returns true if the citusdb extension has been created
|
* CitusHasBeenLoaded returns true if the citus extension has been created
|
||||||
* in the current database and the extension script has been executed. Otherwise,
|
* in the current database and the extension script has been executed. Otherwise,
|
||||||
* it returns false. The result is cached as this is called very frequently.
|
* it returns false. The result is cached as this is called very frequently.
|
||||||
*
|
*
|
||||||
|
@ -301,17 +301,17 @@ LookupDistTableCacheEntry(Oid relationId)
|
||||||
* acceptable.
|
* acceptable.
|
||||||
*/
|
*/
|
||||||
bool
|
bool
|
||||||
CitusDBHasBeenLoaded(void)
|
CitusHasBeenLoaded(void)
|
||||||
{
|
{
|
||||||
static bool extensionLoaded = false;
|
static bool extensionLoaded = false;
|
||||||
|
|
||||||
/* recheck presence until citusdb has been loaded */
|
/* recheck presence until citus has been loaded */
|
||||||
if (!extensionLoaded)
|
if (!extensionLoaded)
|
||||||
{
|
{
|
||||||
bool extensionPresent = false;
|
bool extensionPresent = false;
|
||||||
bool extensionScriptExecuted = true;
|
bool extensionScriptExecuted = true;
|
||||||
|
|
||||||
Oid extensionOid = get_extension_oid("citusdb", true);
|
Oid extensionOid = get_extension_oid("citus", true);
|
||||||
if (extensionOid != InvalidOid)
|
if (extensionOid != InvalidOid)
|
||||||
{
|
{
|
||||||
extensionPresent = true;
|
extensionPresent = true;
|
||||||
|
@ -319,7 +319,7 @@ CitusDBHasBeenLoaded(void)
|
||||||
|
|
||||||
if (extensionPresent)
|
if (extensionPresent)
|
||||||
{
|
{
|
||||||
/* check if CitusDB extension objects are still being created */
|
/* check if Citus extension objects are still being created */
|
||||||
if (creating_extension && CurrentExtensionObject == extensionOid)
|
if (creating_extension && CurrentExtensionObject == extensionOid)
|
||||||
{
|
{
|
||||||
extensionScriptExecuted = false;
|
extensionScriptExecuted = false;
|
||||||
|
@ -428,7 +428,7 @@ CitusExtraDataContainerFuncId(void)
|
||||||
if (cachedOid == InvalidOid)
|
if (cachedOid == InvalidOid)
|
||||||
{
|
{
|
||||||
nameList = list_make2(makeString("pg_catalog"),
|
nameList = list_make2(makeString("pg_catalog"),
|
||||||
makeString("citusdb_extradata_container"));
|
makeString("citus_extradata_container"));
|
||||||
cachedOid = LookupFuncName(nameList, 1, paramOids, false);
|
cachedOid = LookupFuncName(nameList, 1, paramOids, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*-------------------------------------------------------------------------
|
/*-------------------------------------------------------------------------
|
||||||
*
|
*
|
||||||
* multi_resowner.c
|
* multi_resowner.c
|
||||||
* CitusDB resource owner integration
|
* Citus resource owner integration
|
||||||
*
|
*
|
||||||
* An extension can't directly add members to ResourceOwnerData. Instead we
|
* An extension can't directly add members to ResourceOwnerData. Instead we
|
||||||
* have to use the resource owner callback mechanism. Right now it's
|
* have to use the resource owner callback mechanism. Right now it's
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*-------------------------------------------------------------------------
|
/*-------------------------------------------------------------------------
|
||||||
*
|
*
|
||||||
* resource_lock.c
|
* resource_lock.c
|
||||||
* Locking Infrastructure for CitusDB.
|
* Locking Infrastructure for Citus.
|
||||||
*
|
*
|
||||||
* To avoid introducing a new type of locktag - that then could not be
|
* To avoid introducing a new type of locktag - that then could not be
|
||||||
* displayed by core functionality - we reuse advisory locks. If we'd just
|
* displayed by core functionality - we reuse advisory locks. If we'd just
|
||||||
|
|
|
@ -240,7 +240,7 @@ TaskTrackerMain(Datum main_arg)
|
||||||
/*
|
/*
|
||||||
* Reload worker membership file. For now we do that in the task
|
* Reload worker membership file. For now we do that in the task
|
||||||
* tracker because that's currently the only background worker in
|
* tracker because that's currently the only background worker in
|
||||||
* CitusDB. And only background workers allow us to safely
|
* Citus. And only background workers allow us to safely
|
||||||
* register a SIGHUP handler.
|
* register a SIGHUP handler.
|
||||||
*/
|
*/
|
||||||
LoadWorkerNodeList(WorkerListFileName);
|
LoadWorkerNodeList(WorkerListFileName);
|
||||||
|
@ -295,7 +295,7 @@ WorkerTasksHashEnter(uint64 jobId, uint32 taskId)
|
||||||
{
|
{
|
||||||
ereport(ERROR, (errcode(ERRCODE_OUT_OF_MEMORY),
|
ereport(ERROR, (errcode(ERRCODE_OUT_OF_MEMORY),
|
||||||
errmsg("out of shared memory"),
|
errmsg("out of shared memory"),
|
||||||
errhint("Try increasing citusdb.max_tracked_tasks_per_node.")));
|
errhint("Try increasing citus.max_tracked_tasks_per_node.")));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* check that we do not have the same task assigned twice to this node */
|
/* check that we do not have the same task assigned twice to this node */
|
||||||
|
|
|
@ -9,12 +9,12 @@
|
||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
|
|
||||||
citusdb_subdir = src/bin/csql
|
citus_subdir = src/bin/csql
|
||||||
citusdb_top_builddir = ../../..
|
citus_top_builddir = ../../..
|
||||||
|
|
||||||
PROGRAM = csql
|
PROGRAM = csql
|
||||||
|
|
||||||
PGFILEDESC = "csql - the CitusDB interactive terminal"
|
PGFILEDESC = "csql - the Citus interactive terminal"
|
||||||
PGAPPICON=win32
|
PGAPPICON=win32
|
||||||
|
|
||||||
OBJS =command.o common.o help.o input.o stringutils.o mainloop.o copy.o \
|
OBJS =command.o common.o help.o input.o stringutils.o mainloop.o copy.o \
|
||||||
|
@ -26,7 +26,7 @@ OBJS =command.o common.o help.o input.o stringutils.o mainloop.o copy.o \
|
||||||
|
|
||||||
PG_LIBS = $(libpq)
|
PG_LIBS = $(libpq)
|
||||||
|
|
||||||
include $(citusdb_top_builddir)/Makefile.global
|
include $(citus_top_builddir)/Makefile.global
|
||||||
|
|
||||||
override CPPFLAGS += -I$(libpq_srcdir) -I$(top_srcdir)/src/bin/csql
|
override CPPFLAGS += -I$(libpq_srcdir) -I$(top_srcdir)/src/bin/csql
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* csql - the CitusDB interactive terminal
|
* csql - the Citus interactive terminal
|
||||||
* copy_options.c
|
* copy_options.c
|
||||||
* Routines for parsing copy and stage meta commands.
|
* Routines for parsing copy and stage meta commands.
|
||||||
*
|
*
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* csql - the CitusDB interactive terminal
|
* csql - the Citus interactive terminal
|
||||||
* copy_options.h
|
* copy_options.h
|
||||||
* Shared declarations for parsing copy and stage meta-commands. The stage
|
* Shared declarations for parsing copy and stage meta-commands. The stage
|
||||||
* meta-command borrows from copy's syntax, but does not yet support
|
* meta-command borrows from copy's syntax, but does not yet support
|
||||||
|
|
|
@ -67,7 +67,7 @@ usage(unsigned short int pager)
|
||||||
|
|
||||||
output = PageOutput(59, pager ? &(pset.popt.topt) : NULL);
|
output = PageOutput(59, pager ? &(pset.popt.topt) : NULL);
|
||||||
|
|
||||||
printf(_("csql is the CitusDB interactive terminal.\n\n"));
|
printf(_("csql is the Citus interactive terminal.\n\n"));
|
||||||
fprintf(output, _("Usage:\n"));
|
fprintf(output, _("Usage:\n"));
|
||||||
printf(_(" csql [OPTION]... [DBNAME [USERNAME]]\n\n"));
|
printf(_(" csql [OPTION]... [DBNAME [USERNAME]]\n\n"));
|
||||||
|
|
||||||
|
|
|
@ -200,7 +200,7 @@ MainLoop(FILE *source)
|
||||||
(line[4] == '\0' || line[4] == ';' || isspace((unsigned char) line[4])))
|
(line[4] == '\0' || line[4] == ';' || isspace((unsigned char) line[4])))
|
||||||
{
|
{
|
||||||
free(line);
|
free(line);
|
||||||
puts(_("You are using csql, the command-line interface to CitusDB."));
|
puts(_("You are using csql, the command-line interface to Citus."));
|
||||||
printf(_("Type: \\copyright for distribution terms\n"
|
printf(_("Type: \\copyright for distribution terms\n"
|
||||||
" \\h for help with SQL commands\n"
|
" \\h for help with SQL commands\n"
|
||||||
" \\? for help with csql commands\n"
|
" \\? for help with csql commands\n"
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* csql - the CitusDB interactive terminal
|
* csql - the Citus interactive terminal
|
||||||
* stage.c
|
* stage.c
|
||||||
* Helper routines to execute the csql meta-command \stage. These routines
|
* Helper routines to execute the csql meta-command \stage. These routines
|
||||||
* communicate with the master and worker nodes; and create new shards and
|
* communicate with the master and worker nodes; and create new shards and
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* csql - the CitusDB interactive terminal
|
* csql - the Citus interactive terminal
|
||||||
* stage.h
|
* stage.h
|
||||||
* Declarations for the csql meta-command \stage. These declarations define a
|
* Declarations for the csql meta-command \stage. These declarations define a
|
||||||
* protocol for the client to communicate to the master and worker nodes.
|
* protocol for the client to communicate to the master and worker nodes.
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/stamp-h
|
/stamp-h
|
||||||
/stamp-ext-h
|
/stamp-ext-h
|
||||||
/citusdb_config.h
|
/citus_config.h
|
||||||
/citusdb_config.h.in~
|
/citus_config.h.in~
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
/* src/include/citusdb_config.h.in. Generated from configure.in by autoheader. */
|
/* src/include/citus_config.h.in. Generated from configure.in by autoheader. */
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* citusdb_config.h.in is generated by autoconf/autoheader and
|
* citus_config.h.in is generated by autoconf/autoheader and
|
||||||
* converted into citusdb_config.h by configure. Include when code needs to
|
* converted into citus_config.h by configure. Include when code needs to
|
||||||
* depend on determinations made by configure.
|
* depend on determinations made by configure.
|
||||||
*
|
*
|
||||||
* Do not manually edit!
|
* Do not manually edit!
|
|
@ -1,7 +1,7 @@
|
||||||
/*-------------------------------------------------------------------------
|
/*-------------------------------------------------------------------------
|
||||||
*
|
*
|
||||||
* citus_nodefuncs.h
|
* citus_nodefuncs.h
|
||||||
* Node (de-)serialization support for CitusDB.
|
* Node (de-)serialization support for Citus.
|
||||||
*
|
*
|
||||||
* Copyright (c) 2012-2015, Citus Data, Inc.
|
* Copyright (c) 2012-2015, Citus Data, Inc.
|
||||||
*
|
*
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*-------------------------------------------------------------------------
|
/*-------------------------------------------------------------------------
|
||||||
*
|
*
|
||||||
* citus_nodes.h
|
* citus_nodes.h
|
||||||
* Additional node types, and related infrastructure, for CitusDB.
|
* Additional node types, and related infrastructure, for Citus.
|
||||||
*
|
*
|
||||||
* Copyright (c) 2012-2015, Citus Data, Inc.
|
* Copyright (c) 2012-2015, Citus Data, Inc.
|
||||||
*
|
*
|
||||||
|
@ -52,7 +52,7 @@ typedef enum CitusNodeTag
|
||||||
#define CitusIsA(nodeptr,_type_) (CitusNodeTag(nodeptr) == T_##_type_)
|
#define CitusIsA(nodeptr,_type_) (CitusNodeTag(nodeptr) == T_##_type_)
|
||||||
|
|
||||||
|
|
||||||
/* CitusDB variant of newNode(), don't use directly. */
|
/* Citus variant of newNode(), don't use directly. */
|
||||||
#define CitusNewNode(size, tag) \
|
#define CitusNewNode(size, tag) \
|
||||||
({ Node *_result; \
|
({ Node *_result; \
|
||||||
AssertMacro((size) >= sizeof(Node)); /* need the tag, at least */ \
|
AssertMacro((size) >= sizeof(Node)); /* need the tag, at least */ \
|
||||||
|
@ -63,7 +63,7 @@ typedef enum CitusNodeTag
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* CitusMakeNode is CitusDB variant of makeNode(). Use it to create nodes of
|
* CitusMakeNode is Citus variant of makeNode(). Use it to create nodes of
|
||||||
* the types listed in the CitusNodeTag enum and plain NodeTag. Initializes
|
* the types listed in the CitusNodeTag enum and plain NodeTag. Initializes
|
||||||
* memory, besides the node tag, to 0.
|
* memory, besides the node tag, to 0.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*-------------------------------------------------------------------------
|
/*-------------------------------------------------------------------------
|
||||||
*
|
*
|
||||||
* citus_ruleutils.h
|
* citus_ruleutils.h
|
||||||
* CitusDB ruleutils wrapper functions and exported PostgreSQL ruleutils
|
* Citus ruleutils wrapper functions and exported PostgreSQL ruleutils
|
||||||
* functions.
|
* functions.
|
||||||
*
|
*
|
||||||
* Copyright (c) 2012-2015, Citus Data, Inc.
|
* Copyright (c) 2012-2015, Citus Data, Inc.
|
||||||
|
@ -15,7 +15,7 @@
|
||||||
#include "nodes/parsenodes.h"
|
#include "nodes/parsenodes.h"
|
||||||
|
|
||||||
|
|
||||||
/* Function declarations for version independent CitusDB ruleutils wrapper functions */
|
/* Function declarations for version independent Citus ruleutils wrapper functions */
|
||||||
extern char *pg_get_extensiondef_string(Oid tableRelationId);
|
extern char *pg_get_extensiondef_string(Oid tableRelationId);
|
||||||
extern char *pg_get_serverdef_string(Oid tableRelationId);
|
extern char *pg_get_serverdef_string(Oid tableRelationId);
|
||||||
extern char *pg_get_tableschemadef_string(Oid tableRelationId);
|
extern char *pg_get_tableschemadef_string(Oid tableRelationId);
|
||||||
|
|
|
@ -9,8 +9,8 @@
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef CITUSDB_LISTUTILS_H
|
#ifndef CITUS_LISTUTILS_H
|
||||||
#define CITUSDB_LISTUTILS_H
|
#define CITUS_LISTUTILS_H
|
||||||
|
|
||||||
#include "postgres.h"
|
#include "postgres.h"
|
||||||
#include "c.h"
|
#include "c.h"
|
||||||
|
@ -23,4 +23,4 @@ extern List * SortList(List *pointerList,
|
||||||
int (*ComparisonFunction)(const void *, const void *));
|
int (*ComparisonFunction)(const void *, const void *));
|
||||||
|
|
||||||
|
|
||||||
#endif /* CITUSDB_LISTUTILS_H */
|
#endif /* CITUS_LISTUTILS_H */
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*-------------------------------------------------------------------------
|
/*-------------------------------------------------------------------------
|
||||||
*
|
*
|
||||||
* metadata_cache.h
|
* metadata_cache.h
|
||||||
* Executor support for CitusDB.
|
* Executor support for Citus.
|
||||||
*
|
*
|
||||||
* Copyright (c) 2012-2015, Citus Data, Inc.
|
* Copyright (c) 2012-2015, Citus Data, Inc.
|
||||||
*
|
*
|
||||||
|
@ -46,7 +46,7 @@ extern bool IsDistributedTable(Oid relationId);
|
||||||
extern ShardInterval * LoadShardInterval(uint64 shardId);
|
extern ShardInterval * LoadShardInterval(uint64 shardId);
|
||||||
extern DistTableCacheEntry * DistributedTableCacheEntry(Oid distributedRelationId);
|
extern DistTableCacheEntry * DistributedTableCacheEntry(Oid distributedRelationId);
|
||||||
|
|
||||||
extern bool CitusDBHasBeenLoaded(void);
|
extern bool CitusHasBeenLoaded(void);
|
||||||
|
|
||||||
/* relation oids */
|
/* relation oids */
|
||||||
extern Oid DistPartitionRelationId(void);
|
extern Oid DistPartitionRelationId(void);
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*-------------------------------------------------------------------------
|
/*-------------------------------------------------------------------------
|
||||||
*
|
*
|
||||||
* multi_executor.h
|
* multi_executor.h
|
||||||
* Executor support for CitusDB.
|
* Executor support for Citus.
|
||||||
*
|
*
|
||||||
* Copyright (c) 2012-2015, Citus Data, Inc.
|
* Copyright (c) 2012-2015, Citus Data, Inc.
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*-------------------------------------------------------------------------
|
/*-------------------------------------------------------------------------
|
||||||
*
|
*
|
||||||
* multi_explain.h
|
* multi_explain.h
|
||||||
* Explain support for CitusDB.
|
* Explain support for Citus.
|
||||||
*
|
*
|
||||||
* Copyright (c) 2012-2015, Citus Data, Inc.
|
* Copyright (c) 2012-2015, Citus Data, Inc.
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*-------------------------------------------------------------------------
|
/*-------------------------------------------------------------------------
|
||||||
*
|
*
|
||||||
* multi_planner.h
|
* multi_planner.h
|
||||||
* General CitusDB planner code.
|
* General Citus planner code.
|
||||||
*
|
*
|
||||||
* Copyright (c) 2012-2015, Citus Data, Inc.
|
* Copyright (c) 2012-2015, Citus Data, Inc.
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*-------------------------------------------------------------------------
|
/*-------------------------------------------------------------------------
|
||||||
*
|
*
|
||||||
* multi_resowner.h
|
* multi_resowner.h
|
||||||
* CitusDB resource owner integration.
|
* Citus resource owner integration.
|
||||||
*
|
*
|
||||||
* Copyright (c) 2012-2015, Citus Data, Inc.
|
* Copyright (c) 2012-2015, Citus Data, Inc.
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*-------------------------------------------------------------------------
|
/*-------------------------------------------------------------------------
|
||||||
*
|
*
|
||||||
* multi_utility.h
|
* multi_utility.h
|
||||||
* CitusDB utility hook and related functionality.
|
* Citus utility hook and related functionality.
|
||||||
*
|
*
|
||||||
* Copyright (c) 2012-2015, Citus Data, Inc.
|
* Copyright (c) 2012-2015, Citus Data, Inc.
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*-------------------------------------------------------------------------
|
/*-------------------------------------------------------------------------
|
||||||
*
|
*
|
||||||
* resource_lock.h
|
* resource_lock.h
|
||||||
* Locking Infrastructure for CitusDB.
|
* Locking Infrastructure for Citus.
|
||||||
*
|
*
|
||||||
* Copyright (c) 2012-2015, Citus Data, Inc.
|
* Copyright (c) 2012-2015, Citus Data, Inc.
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
|
@ -21,7 +21,7 @@
|
||||||
* advisory locks. Only 1 and 2 are used allowing us to define non-conflicting
|
* advisory locks. Only 1 and 2 are used allowing us to define non-conflicting
|
||||||
* lock methods.
|
* lock methods.
|
||||||
*
|
*
|
||||||
* In case postgres starts to use additional values, CitusDB's values
|
* In case postgres starts to use additional values, Citus's values
|
||||||
* will have to be changed. That just requires re-compiling and a restart.
|
* will have to be changed. That just requires re-compiling and a restart.
|
||||||
*/
|
*/
|
||||||
typedef enum AdvisoryLocktagClass
|
typedef enum AdvisoryLocktagClass
|
||||||
|
@ -29,7 +29,7 @@ typedef enum AdvisoryLocktagClass
|
||||||
/* values defined in postgres' lockfuncs.c */
|
/* values defined in postgres' lockfuncs.c */
|
||||||
ADV_LOCKTAG_CLASS_INT64 = 1,
|
ADV_LOCKTAG_CLASS_INT64 = 1,
|
||||||
ADV_LOCKTAG_CLASS_INT32 = 2,
|
ADV_LOCKTAG_CLASS_INT32 = 2,
|
||||||
/* CitusDB lock types */
|
/* Citus lock types */
|
||||||
ADV_LOCKTAG_CLASS_CITUS_SHARD_METADATA = 4,
|
ADV_LOCKTAG_CLASS_CITUS_SHARD_METADATA = 4,
|
||||||
ADV_LOCKTAG_CLASS_CITUS_SHARD = 5,
|
ADV_LOCKTAG_CLASS_CITUS_SHARD = 5,
|
||||||
ADV_LOCKTAG_CLASS_CITUS_JOB = 6
|
ADV_LOCKTAG_CLASS_CITUS_JOB = 6
|
||||||
|
|
|
@ -10,8 +10,8 @@
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef CITUSDB_TEST_HELPER_FUNCTIONS_H
|
#ifndef CITUS_TEST_HELPER_FUNCTIONS_H
|
||||||
#define CITUSDB_TEST_HELPER_FUNCTIONS_H
|
#define CITUS_TEST_HELPER_FUNCTIONS_H
|
||||||
|
|
||||||
#include "postgres.h"
|
#include "postgres.h"
|
||||||
#include "c.h"
|
#include "c.h"
|
||||||
|
@ -70,4 +70,4 @@ extern Datum prune_using_both_values(PG_FUNCTION_ARGS);
|
||||||
extern Datum debug_equality_expression(PG_FUNCTION_ARGS);
|
extern Datum debug_equality_expression(PG_FUNCTION_ARGS);
|
||||||
|
|
||||||
|
|
||||||
#endif /* CITUSDB_TEST_HELPER_FUNCTIONS_H */
|
#endif /* CITUS_TEST_HELPER_FUNCTIONS_H */
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
/* Maximum length of worker port number (represented as string) */
|
/* Maximum length of worker port number (represented as string) */
|
||||||
#define MAX_PORT_LENGTH 10
|
#define MAX_PORT_LENGTH 10
|
||||||
|
|
||||||
/* default filename for citusdb.worker_list_file */
|
/* default filename for citus.worker_list_file */
|
||||||
#define WORKER_LIST_FILENAME "pg_worker_list.conf"
|
#define WORKER_LIST_FILENAME "pg_worker_list.conf"
|
||||||
|
|
||||||
/* Implementation specific definitions used in finding worker nodes */
|
/* Implementation specific definitions used in finding worker nodes */
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
# Makefile for tests of the CitusDB extension
|
# Makefile for tests of the Citus extension
|
||||||
|
|
||||||
citusdb_subdir = src/test/regress
|
citus_subdir = src/test/regress
|
||||||
citusdb_top_builddir = ../../..
|
citus_top_builddir = ../../..
|
||||||
|
|
||||||
include $(citusdb_top_builddir)/Makefile.global
|
include $(citus_top_builddir)/Makefile.global
|
||||||
|
|
||||||
# ensure MAJORVERSION is defined (missing in older versions)
|
# ensure MAJORVERSION is defined (missing in older versions)
|
||||||
ifndef MAJORVERSION
|
ifndef MAJORVERSION
|
||||||
|
@ -11,11 +11,11 @@ MAJORVERSION := $(basename $(VERSION))
|
||||||
endif
|
endif
|
||||||
|
|
||||||
##
|
##
|
||||||
## CitusDB regression support
|
## Citus regression support
|
||||||
##
|
##
|
||||||
MULTI_INSTALLDIR=$(CURDIR)/tmp_check/install
|
MULTI_INSTALLDIR=$(CURDIR)/tmp_check/install
|
||||||
pg_regress_multi_check = $(PERL) $(citusdb_abs_srcdir)/pg_regress_multi.pl --pgxsdir="$(pgxsdir)" --bindir="$(bindir)" --libdir="$(libdir)" --majorversion="$(MAJORVERSION)"
|
pg_regress_multi_check = $(PERL) $(citus_abs_srcdir)/pg_regress_multi.pl --pgxsdir="$(pgxsdir)" --bindir="$(bindir)" --libdir="$(libdir)" --majorversion="$(MAJORVERSION)"
|
||||||
MULTI_REGRESS_OPTS = --inputdir=$(citusdb_abs_srcdir) $(pg_regress_locale_flags)
|
MULTI_REGRESS_OPTS = --inputdir=$(citus_abs_srcdir) $(pg_regress_locale_flags)
|
||||||
|
|
||||||
# XXX: Can't actually do useful testruns against install - $libdir
|
# XXX: Can't actually do useful testruns against install - $libdir
|
||||||
# etc will point to the directory configured during postgres'
|
# etc will point to the directory configured during postgres'
|
||||||
|
@ -26,12 +26,12 @@ cleandir-main:
|
||||||
###
|
###
|
||||||
tempinstall-main: cleandir-main
|
tempinstall-main: cleandir-main
|
||||||
#### mkdir -p $(MULTI_INSTALLDIR)
|
#### mkdir -p $(MULTI_INSTALLDIR)
|
||||||
### $(MAKE) DESTDIR=$(MULTI_INSTALLDIR) -C $(citusdb_top_builddir) install > tmp_check/install.log 2>&1
|
### $(MAKE) DESTDIR=$(MULTI_INSTALLDIR) -C $(citus_top_builddir) install > tmp_check/install.log 2>&1
|
||||||
|
|
||||||
# Test input and expected files. These are created by pg_regress itself, so we
|
# Test input and expected files. These are created by pg_regress itself, so we
|
||||||
# don't have a rule to create them. We do need rules to clean them however.
|
# don't have a rule to create them. We do need rules to clean them however.
|
||||||
input_files := $(patsubst $(citusdb_abs_srcdir)/input/%.source,sql/%.sql, $(wildcard $(citusdb_abs_srcdir)/input/*.source))
|
input_files := $(patsubst $(citus_abs_srcdir)/input/%.source,sql/%.sql, $(wildcard $(citus_abs_srcdir)/input/*.source))
|
||||||
output_files := $(patsubst $(citusdb_abs_srcdir)/output/%.source,expected/%.out, $(wildcard $(citusdb_abs_srcdir)/output/*.source))
|
output_files := $(patsubst $(citus_abs_srcdir)/output/%.source,expected/%.out, $(wildcard $(citus_abs_srcdir)/output/*.source))
|
||||||
|
|
||||||
# have make check actually run all tests, but keep check-full as an
|
# have make check actually run all tests, but keep check-full as an
|
||||||
# intermediate, for muscle memory backward compatibility.
|
# intermediate, for muscle memory backward compatibility.
|
||||||
|
@ -42,32 +42,32 @@ check-full: check-multi check-multi-task-tracker check-multi-binary check-worker
|
||||||
# using pg_regress_multi_check unnecessarily starts up multiple nodes, which isn't needed
|
# using pg_regress_multi_check unnecessarily starts up multiple nodes, which isn't needed
|
||||||
# for check-worker. But that's harmless besides a few cycles.
|
# for check-worker. But that's harmless besides a few cycles.
|
||||||
check-worker: all
|
check-worker: all
|
||||||
$(pg_regress_multi_check) --load-extension=citusdb \
|
$(pg_regress_multi_check) --load-extension=citus \
|
||||||
-- $(MULTI_REGRESS_OPTS) --schedule=$(citusdb_abs_srcdir)/worker_schedule $(EXTRA_TESTS)
|
-- $(MULTI_REGRESS_OPTS) --schedule=$(citus_abs_srcdir)/worker_schedule $(EXTRA_TESTS)
|
||||||
|
|
||||||
check-multi: all tempinstall-main
|
check-multi: all tempinstall-main
|
||||||
$(pg_regress_multi_check) --load-extension=citusdb \
|
$(pg_regress_multi_check) --load-extension=citus \
|
||||||
-- $(MULTI_REGRESS_OPTS) --schedule=$(citusdb_abs_srcdir)/multi_schedule $(EXTRA_TESTS)
|
-- $(MULTI_REGRESS_OPTS) --schedule=$(citus_abs_srcdir)/multi_schedule $(EXTRA_TESTS)
|
||||||
|
|
||||||
check-multi-fdw: all tempinstall-main
|
check-multi-fdw: all tempinstall-main
|
||||||
$(pg_regress_multi_check) --load-extension=citusdb --load-extension=file_fdw -- \
|
$(pg_regress_multi_check) --load-extension=citus --load-extension=file_fdw -- \
|
||||||
$(MULTI_REGRESS_OPTS) --schedule=$(citusdb_abs_srcdir)/multi_fdw_schedule $(EXTRA_TESTS)
|
$(MULTI_REGRESS_OPTS) --schedule=$(citus_abs_srcdir)/multi_fdw_schedule $(EXTRA_TESTS)
|
||||||
|
|
||||||
check-multi-hll: all tempinstall-main
|
check-multi-hll: all tempinstall-main
|
||||||
$(pg_regress_multi_check) --load-extension=citusdb --load-extension=hll -- \
|
$(pg_regress_multi_check) --load-extension=citus --load-extension=hll -- \
|
||||||
$(MULTI_REGRESS_OPTS) $(EXTRA_TESTS) multi_create_table multi_master_protocol multi_stage_data multi_agg_approximate_distinct
|
$(MULTI_REGRESS_OPTS) $(EXTRA_TESTS) multi_create_table multi_master_protocol multi_stage_data multi_agg_approximate_distinct
|
||||||
|
|
||||||
check-multi-task-tracker: all tempinstall-main
|
check-multi-task-tracker: all tempinstall-main
|
||||||
$(pg_regress_multi_check) --load-extension=citusdb \
|
$(pg_regress_multi_check) --load-extension=citus \
|
||||||
--server-option=citusdb.task_executor_type=task-tracker \
|
--server-option=citus.task_executor_type=task-tracker \
|
||||||
--server-option=citusdb.task_tracker_delay=50ms \
|
--server-option=citus.task_tracker_delay=50ms \
|
||||||
--server-option=citusdb.large_table_shard_count=1 \
|
--server-option=citus.large_table_shard_count=1 \
|
||||||
-- $(MULTI_REGRESS_OPTS) --schedule=$(citusdb_abs_srcdir)/multi_schedule $(EXTRA_TESTS)
|
-- $(MULTI_REGRESS_OPTS) --schedule=$(citus_abs_srcdir)/multi_schedule $(EXTRA_TESTS)
|
||||||
|
|
||||||
check-multi-binary: all tempinstall-main
|
check-multi-binary: all tempinstall-main
|
||||||
$(pg_regress_multi_check) --load-extension=citusdb \
|
$(pg_regress_multi_check) --load-extension=citus \
|
||||||
--server-option=citusdb.binary_worker_copy_format=on \
|
--server-option=citus.binary_worker_copy_format=on \
|
||||||
-- $(MULTI_REGRESS_OPTS) --schedule=$(citusdb_abs_srcdir)/multi_schedule $(EXTRA_TESTS)
|
-- $(MULTI_REGRESS_OPTS) --schedule=$(citus_abs_srcdir)/multi_schedule $(EXTRA_TESTS)
|
||||||
|
|
||||||
clean distclean maintainer-clean:
|
clean distclean maintainer-clean:
|
||||||
rm -f $(output_files) $(input_files)
|
rm -f $(output_files) $(input_files)
|
||||||
|
|
|
@ -7,14 +7,14 @@ ERROR: cannot compute aggregate (distinct)
|
||||||
DETAIL: table partitioning is unsuitable for aggregate (distinct)
|
DETAIL: table partitioning is unsuitable for aggregate (distinct)
|
||||||
HINT: You can load the hll extension from contrib packages and enable distinct approximations.
|
HINT: You can load the hll extension from contrib packages and enable distinct approximations.
|
||||||
-- Check approximate count(distinct) at different precisions / error rates
|
-- Check approximate count(distinct) at different precisions / error rates
|
||||||
SET citusdb.count_distinct_error_rate = 0.1;
|
SET citus.count_distinct_error_rate = 0.1;
|
||||||
SELECT count(distinct l_orderkey) FROM lineitem;
|
SELECT count(distinct l_orderkey) FROM lineitem;
|
||||||
count
|
count
|
||||||
-------
|
-------
|
||||||
2612
|
2612
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
SET citusdb.count_distinct_error_rate = 0.01;
|
SET citus.count_distinct_error_rate = 0.01;
|
||||||
SELECT count(distinct l_orderkey) FROM lineitem;
|
SELECT count(distinct l_orderkey) FROM lineitem;
|
||||||
count
|
count
|
||||||
-------
|
-------
|
||||||
|
@ -102,7 +102,7 @@ SELECT count(DISTINCT l_orderkey) as distinct_order_count, l_quantity FROM linei
|
||||||
|
|
||||||
-- If we have an order by on count(distinct) that we intend to push down to
|
-- If we have an order by on count(distinct) that we intend to push down to
|
||||||
-- worker nodes, we need to error out. Otherwise, we are fine.
|
-- worker nodes, we need to error out. Otherwise, we are fine.
|
||||||
SET citusdb.limit_clause_row_fetch_count = 1000;
|
SET citus.limit_clause_row_fetch_count = 1000;
|
||||||
SELECT l_returnflag, count(DISTINCT l_shipdate) as count_distinct, count(*) as total
|
SELECT l_returnflag, count(DISTINCT l_shipdate) as count_distinct, count(*) as total
|
||||||
FROM lineitem
|
FROM lineitem
|
||||||
GROUP BY l_returnflag
|
GROUP BY l_returnflag
|
||||||
|
@ -123,7 +123,7 @@ SELECT l_returnflag, count(DISTINCT l_shipdate) as count_distinct, count(*) as t
|
||||||
(3 rows)
|
(3 rows)
|
||||||
|
|
||||||
-- Check that we can revert config and disable count(distinct) approximations
|
-- Check that we can revert config and disable count(distinct) approximations
|
||||||
SET citusdb.count_distinct_error_rate = 0.0;
|
SET citus.count_distinct_error_rate = 0.0;
|
||||||
SELECT count(distinct l_orderkey) FROM lineitem;
|
SELECT count(distinct l_orderkey) FROM lineitem;
|
||||||
ERROR: cannot compute aggregate (distinct)
|
ERROR: cannot compute aggregate (distinct)
|
||||||
DETAIL: table partitioning is unsuitable for aggregate (distinct)
|
DETAIL: table partitioning is unsuitable for aggregate (distinct)
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
-- MULTI_BINARY_MASTER_COPY
|
-- MULTI_BINARY_MASTER_COPY
|
||||||
--
|
--
|
||||||
-- Try binary master copy for different executors
|
-- Try binary master copy for different executors
|
||||||
SET citusdb.binary_master_copy_format TO 'on';
|
SET citus.binary_master_copy_format TO 'on';
|
||||||
SET citusdb.task_executor_type TO 'task-tracker';
|
SET citus.task_executor_type TO 'task-tracker';
|
||||||
SELECT count(*) FROM lineitem;
|
SELECT count(*) FROM lineitem;
|
||||||
count
|
count
|
||||||
-------
|
-------
|
||||||
|
@ -17,7 +17,7 @@ SELECT l_shipmode FROM lineitem WHERE l_partkey = 67310 OR l_partkey = 155190;
|
||||||
MAIL
|
MAIL
|
||||||
(2 rows)
|
(2 rows)
|
||||||
|
|
||||||
SET citusdb.task_executor_type TO 'real-time';
|
SET citus.task_executor_type TO 'real-time';
|
||||||
SELECT count(*) FROM lineitem;
|
SELECT count(*) FROM lineitem;
|
||||||
count
|
count
|
||||||
-------
|
-------
|
||||||
|
|
|
@ -3,19 +3,19 @@
|
||||||
-- ===================================================================
|
-- ===================================================================
|
||||||
CREATE FUNCTION initialize_remote_temp_table(cstring, integer)
|
CREATE FUNCTION initialize_remote_temp_table(cstring, integer)
|
||||||
RETURNS bool
|
RETURNS bool
|
||||||
AS 'citusdb'
|
AS 'citus'
|
||||||
LANGUAGE C STRICT;
|
LANGUAGE C STRICT;
|
||||||
CREATE FUNCTION count_remote_temp_table_rows(cstring, integer)
|
CREATE FUNCTION count_remote_temp_table_rows(cstring, integer)
|
||||||
RETURNS integer
|
RETURNS integer
|
||||||
AS 'citusdb'
|
AS 'citus'
|
||||||
LANGUAGE C STRICT;
|
LANGUAGE C STRICT;
|
||||||
CREATE FUNCTION get_and_purge_connection(cstring, integer)
|
CREATE FUNCTION get_and_purge_connection(cstring, integer)
|
||||||
RETURNS bool
|
RETURNS bool
|
||||||
AS 'citusdb'
|
AS 'citus'
|
||||||
LANGUAGE C STRICT;
|
LANGUAGE C STRICT;
|
||||||
CREATE FUNCTION set_connection_status_bad(cstring, integer)
|
CREATE FUNCTION set_connection_status_bad(cstring, integer)
|
||||||
RETURNS bool
|
RETURNS bool
|
||||||
AS 'citusdb'
|
AS 'citus'
|
||||||
LANGUAGE C STRICT;
|
LANGUAGE C STRICT;
|
||||||
-- ===================================================================
|
-- ===================================================================
|
||||||
-- test connection hash functionality
|
-- test connection hash functionality
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
-- create fake fdw for use in tests
|
-- create fake fdw for use in tests
|
||||||
CREATE FUNCTION fake_fdw_handler()
|
CREATE FUNCTION fake_fdw_handler()
|
||||||
RETURNS fdw_handler
|
RETURNS fdw_handler
|
||||||
AS 'citusdb'
|
AS 'citus'
|
||||||
LANGUAGE C STRICT;
|
LANGUAGE C STRICT;
|
||||||
CREATE FOREIGN DATA WRAPPER fake_fdw HANDLER fake_fdw_handler;
|
CREATE FOREIGN DATA WRAPPER fake_fdw HANDLER fake_fdw_handler;
|
||||||
CREATE SERVER fake_fdw_server FOREIGN DATA WRAPPER fake_fdw;
|
CREATE SERVER fake_fdw_server FOREIGN DATA WRAPPER fake_fdw;
|
||||||
|
|
|
@ -9,8 +9,8 @@ CREATE SCHEMA "A$AP Mob"
|
||||||
id bigint PRIMARY KEY,
|
id bigint PRIMARY KEY,
|
||||||
data text NOT NULL DEFAULT 'lorem ipsum'
|
data text NOT NULL DEFAULT 'lorem ipsum'
|
||||||
);
|
);
|
||||||
NOTICE: CitusDB partially supports CREATE SCHEMA for distributed databases
|
NOTICE: Citus partially supports CREATE SCHEMA for distributed databases
|
||||||
DETAIL: schema usage in joins and in some UDFs provided by CitusDB are not supported yet
|
DETAIL: schema usage in joins and in some UDFs provided by Citus are not supported yet
|
||||||
\set insert_target '"A$AP Mob"."Dr. Bronner''s ""Magic"" Soaps"'
|
\set insert_target '"A$AP Mob"."Dr. Bronner''s ""Magic"" Soaps"'
|
||||||
-- create proxy and save proxy table name
|
-- create proxy and save proxy table name
|
||||||
SELECT create_insert_proxy_for_table(:'insert_target') AS proxy_tablename
|
SELECT create_insert_proxy_for_table(:'insert_target') AS proxy_tablename
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
-- ===================================================================
|
-- ===================================================================
|
||||||
CREATE FUNCTION sort_names(cstring, cstring, cstring)
|
CREATE FUNCTION sort_names(cstring, cstring, cstring)
|
||||||
RETURNS cstring
|
RETURNS cstring
|
||||||
AS 'citusdb'
|
AS 'citus'
|
||||||
LANGUAGE C STRICT;
|
LANGUAGE C STRICT;
|
||||||
-- create a custom type...
|
-- create a custom type...
|
||||||
CREATE TYPE dummy_type AS (
|
CREATE TYPE dummy_type AS (
|
||||||
|
@ -47,7 +47,7 @@ SELECT master_create_distributed_table('table_to_distribute', 'bad_column', 'has
|
||||||
ERROR: column "bad_column" of relation "table_to_distribute" does not exist
|
ERROR: column "bad_column" of relation "table_to_distribute" does not exist
|
||||||
-- use unrecognized partition type
|
-- use unrecognized partition type
|
||||||
SELECT master_create_distributed_table('table_to_distribute', 'name', 'unrecognized');
|
SELECT master_create_distributed_table('table_to_distribute', 'name', 'unrecognized');
|
||||||
ERROR: invalid input value for enum citusdb.distribution_type: "unrecognized"
|
ERROR: invalid input value for enum citus.distribution_type: "unrecognized"
|
||||||
LINE 1: ..._distributed_table('table_to_distribute', 'name', 'unrecogni...
|
LINE 1: ..._distributed_table('table_to_distribute', 'name', 'unrecogni...
|
||||||
^
|
^
|
||||||
-- use a partition column of a type lacking any default operator class
|
-- use a partition column of a type lacking any default operator class
|
||||||
|
@ -209,7 +209,7 @@ SELECT master_create_worker_shards('weird_shard_count', 7, 1);
|
||||||
|
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
-- CitusDB ensures all shards are roughly the same size
|
-- Citus ensures all shards are roughly the same size
|
||||||
SELECT shardmaxvalue::integer - shardminvalue::integer AS shard_size
|
SELECT shardmaxvalue::integer - shardminvalue::integer AS shard_size
|
||||||
FROM pg_dist_shard
|
FROM pg_dist_shard
|
||||||
WHERE logicalrelid = 'weird_shard_count'::regclass
|
WHERE logicalrelid = 'weird_shard_count'::regclass
|
||||||
|
|
|
@ -109,7 +109,7 @@ SELECT master_create_distributed_table('supplier', 's_suppkey', 'append');
|
||||||
|
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
-- now test that CitusDB cannot distribute unique constraints that do not include
|
-- now test that Citus cannot distribute unique constraints that do not include
|
||||||
-- the partition column
|
-- the partition column
|
||||||
CREATE TABLE primary_key_on_non_part_col
|
CREATE TABLE primary_key_on_non_part_col
|
||||||
(
|
(
|
||||||
|
@ -127,7 +127,7 @@ CREATE TABLE unique_const_on_non_part_col
|
||||||
SELECT master_create_distributed_table('primary_key_on_non_part_col', 'partition_col', 'hash');
|
SELECT master_create_distributed_table('primary_key_on_non_part_col', 'partition_col', 'hash');
|
||||||
ERROR: cannot distribute relation: "primary_key_on_non_part_col"
|
ERROR: cannot distribute relation: "primary_key_on_non_part_col"
|
||||||
DETAIL: Distributed relations cannot have UNIQUE constraints or PRIMARY KEYs that do not include the partition column.
|
DETAIL: Distributed relations cannot have UNIQUE constraints or PRIMARY KEYs that do not include the partition column.
|
||||||
-- now show that CitusDB can distribute unique constrints that include
|
-- now show that Citus can distribute unique constrints that include
|
||||||
-- the partition column
|
-- the partition column
|
||||||
CREATE TABLE primary_key_on_part_col
|
CREATE TABLE primary_key_on_part_col
|
||||||
(
|
(
|
||||||
|
|
|
@ -3,55 +3,55 @@
|
||||||
-- ===================================================================
|
-- ===================================================================
|
||||||
CREATE FUNCTION load_shard_id_array(regclass)
|
CREATE FUNCTION load_shard_id_array(regclass)
|
||||||
RETURNS bigint[]
|
RETURNS bigint[]
|
||||||
AS 'citusdb'
|
AS 'citus'
|
||||||
LANGUAGE C STRICT;
|
LANGUAGE C STRICT;
|
||||||
CREATE FUNCTION load_shard_interval_array(bigint, anyelement)
|
CREATE FUNCTION load_shard_interval_array(bigint, anyelement)
|
||||||
RETURNS anyarray
|
RETURNS anyarray
|
||||||
AS 'citusdb'
|
AS 'citus'
|
||||||
LANGUAGE C STRICT;
|
LANGUAGE C STRICT;
|
||||||
CREATE FUNCTION load_shard_placement_array(bigint, bool)
|
CREATE FUNCTION load_shard_placement_array(bigint, bool)
|
||||||
RETURNS text[]
|
RETURNS text[]
|
||||||
AS 'citusdb'
|
AS 'citus'
|
||||||
LANGUAGE C STRICT;
|
LANGUAGE C STRICT;
|
||||||
CREATE FUNCTION partition_column_id(regclass)
|
CREATE FUNCTION partition_column_id(regclass)
|
||||||
RETURNS smallint
|
RETURNS smallint
|
||||||
AS 'citusdb'
|
AS 'citus'
|
||||||
LANGUAGE C STRICT;
|
LANGUAGE C STRICT;
|
||||||
CREATE FUNCTION partition_type(regclass)
|
CREATE FUNCTION partition_type(regclass)
|
||||||
RETURNS "char"
|
RETURNS "char"
|
||||||
AS 'citusdb'
|
AS 'citus'
|
||||||
LANGUAGE C STRICT;
|
LANGUAGE C STRICT;
|
||||||
CREATE FUNCTION is_distributed_table(regclass)
|
CREATE FUNCTION is_distributed_table(regclass)
|
||||||
RETURNS boolean
|
RETURNS boolean
|
||||||
AS 'citusdb'
|
AS 'citus'
|
||||||
LANGUAGE C STRICT;
|
LANGUAGE C STRICT;
|
||||||
CREATE FUNCTION column_name_to_column_id(regclass, cstring)
|
CREATE FUNCTION column_name_to_column_id(regclass, cstring)
|
||||||
RETURNS smallint
|
RETURNS smallint
|
||||||
AS 'citusdb'
|
AS 'citus'
|
||||||
LANGUAGE C STRICT;
|
LANGUAGE C STRICT;
|
||||||
CREATE FUNCTION create_monolithic_shard_row(regclass)
|
CREATE FUNCTION create_monolithic_shard_row(regclass)
|
||||||
RETURNS bigint
|
RETURNS bigint
|
||||||
AS 'citusdb'
|
AS 'citus'
|
||||||
LANGUAGE C STRICT;
|
LANGUAGE C STRICT;
|
||||||
CREATE FUNCTION create_healthy_local_shard_placement_row(bigint)
|
CREATE FUNCTION create_healthy_local_shard_placement_row(bigint)
|
||||||
RETURNS void
|
RETURNS void
|
||||||
AS 'citusdb'
|
AS 'citus'
|
||||||
LANGUAGE C STRICT;
|
LANGUAGE C STRICT;
|
||||||
CREATE FUNCTION delete_shard_placement_row(bigint, text, bigint)
|
CREATE FUNCTION delete_shard_placement_row(bigint, text, bigint)
|
||||||
RETURNS bool
|
RETURNS bool
|
||||||
AS 'citusdb'
|
AS 'citus'
|
||||||
LANGUAGE C STRICT;
|
LANGUAGE C STRICT;
|
||||||
CREATE FUNCTION update_shard_placement_row_state(bigint, text, bigint, int)
|
CREATE FUNCTION update_shard_placement_row_state(bigint, text, bigint, int)
|
||||||
RETURNS bool
|
RETURNS bool
|
||||||
AS 'citusdb'
|
AS 'citus'
|
||||||
LANGUAGE C STRICT;
|
LANGUAGE C STRICT;
|
||||||
CREATE FUNCTION acquire_shared_shard_lock(bigint)
|
CREATE FUNCTION acquire_shared_shard_lock(bigint)
|
||||||
RETURNS void
|
RETURNS void
|
||||||
AS 'citusdb'
|
AS 'citus'
|
||||||
LANGUAGE C STRICT;
|
LANGUAGE C STRICT;
|
||||||
CREATE FUNCTION column_name_to_column(regclass, text)
|
CREATE FUNCTION column_name_to_column(regclass, text)
|
||||||
RETURNS text
|
RETURNS text
|
||||||
AS 'citusdb'
|
AS 'citus'
|
||||||
LANGUAGE C STRICT;
|
LANGUAGE C STRICT;
|
||||||
-- ===================================================================
|
-- ===================================================================
|
||||||
-- test distribution metadata functionality
|
-- test distribution metadata functionality
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
-- ===================================================================
|
-- ===================================================================
|
||||||
CREATE FUNCTION table_ddl_command_array(regclass)
|
CREATE FUNCTION table_ddl_command_array(regclass)
|
||||||
RETURNS text[]
|
RETURNS text[]
|
||||||
AS 'citusdb'
|
AS 'citus'
|
||||||
LANGUAGE C STRICT;
|
LANGUAGE C STRICT;
|
||||||
-- ===================================================================
|
-- ===================================================================
|
||||||
-- test ddl command generation functionality
|
-- test ddl command generation functionality
|
||||||
|
@ -33,8 +33,8 @@ SELECT table_ddl_command_array('not_null_table');
|
||||||
|
|
||||||
-- ensure tables not in search path are schema-prefixed
|
-- ensure tables not in search path are schema-prefixed
|
||||||
CREATE SCHEMA not_in_path CREATE TABLE simple_table (id bigint);
|
CREATE SCHEMA not_in_path CREATE TABLE simple_table (id bigint);
|
||||||
NOTICE: CitusDB partially supports CREATE SCHEMA for distributed databases
|
NOTICE: Citus partially supports CREATE SCHEMA for distributed databases
|
||||||
DETAIL: schema usage in joins and in some UDFs provided by CitusDB are not supported yet
|
DETAIL: schema usage in joins and in some UDFs provided by Citus are not supported yet
|
||||||
SELECT table_ddl_command_array('not_in_path.simple_table');
|
SELECT table_ddl_command_array('not_in_path.simple_table');
|
||||||
table_ddl_command_array
|
table_ddl_command_array
|
||||||
-------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
-- ===================================================================
|
-- ===================================================================
|
||||||
CREATE FUNCTION table_ddl_command_array(regclass)
|
CREATE FUNCTION table_ddl_command_array(regclass)
|
||||||
RETURNS text[]
|
RETURNS text[]
|
||||||
AS 'citusdb'
|
AS 'citus'
|
||||||
LANGUAGE C STRICT;
|
LANGUAGE C STRICT;
|
||||||
-- ===================================================================
|
-- ===================================================================
|
||||||
-- test ddl command generation functionality
|
-- test ddl command generation functionality
|
||||||
|
@ -33,8 +33,8 @@ SELECT table_ddl_command_array('not_null_table');
|
||||||
|
|
||||||
-- ensure tables not in search path are schema-prefixed
|
-- ensure tables not in search path are schema-prefixed
|
||||||
CREATE SCHEMA not_in_path CREATE TABLE simple_table (id bigint);
|
CREATE SCHEMA not_in_path CREATE TABLE simple_table (id bigint);
|
||||||
NOTICE: CitusDB partially supports CREATE SCHEMA for distributed databases
|
NOTICE: Citus partially supports CREATE SCHEMA for distributed databases
|
||||||
DETAIL: schema usage in joins and in some UDFs provided by CitusDB are not supported yet
|
DETAIL: schema usage in joins and in some UDFs provided by Citus are not supported yet
|
||||||
SELECT table_ddl_command_array('not_in_path.simple_table');
|
SELECT table_ddl_command_array('not_in_path.simple_table');
|
||||||
table_ddl_command_array
|
table_ddl_command_array
|
||||||
-------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
-- MULTI_JOIN_ORDER_ADDITIONAL
|
-- MULTI_JOIN_ORDER_ADDITIONAL
|
||||||
--
|
--
|
||||||
-- Set configuration to print table join order and pruned shards
|
-- Set configuration to print table join order and pruned shards
|
||||||
SET citusdb.log_multi_join_order TO TRUE;
|
SET citus.log_multi_join_order TO TRUE;
|
||||||
SET client_min_messages TO DEBUG2;
|
SET client_min_messages TO DEBUG2;
|
||||||
-- The following query checks that we can correctly handle self-joins
|
-- The following query checks that we can correctly handle self-joins
|
||||||
EXPLAIN SELECT l1.l_quantity FROM lineitem l1, lineitem l2
|
EXPLAIN SELECT l1.l_quantity FROM lineitem l1, lineitem l2
|
||||||
|
@ -42,7 +42,7 @@ DEBUG: join prunable for intervals [1,2496] and [2497,4964]
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
-- Update configuration to treat lineitem and orders tables as large
|
-- Update configuration to treat lineitem and orders tables as large
|
||||||
SET citusdb.large_table_shard_count TO 2;
|
SET citus.large_table_shard_count TO 2;
|
||||||
SET client_min_messages TO LOG;
|
SET client_min_messages TO LOG;
|
||||||
-- The following queries check that we correctly handle joins and OR clauses. In
|
-- The following queries check that we correctly handle joins and OR clauses. In
|
||||||
-- particular, these queries check that we factorize out OR clauses if possible,
|
-- particular, these queries check that we factorize out OR clauses if possible,
|
||||||
|
@ -106,7 +106,7 @@ LOG: join order: [ "customer" ][ broadcast join "nation" ]
|
||||||
UPDATE pg_dist_partition SET partmethod = 'a' WHERE
|
UPDATE pg_dist_partition SET partmethod = 'a' WHERE
|
||||||
logicalrelid = (SELECT relfilenode FROM pg_class WHERE relname = 'customer');
|
logicalrelid = (SELECT relfilenode FROM pg_class WHERE relname = 'customer');
|
||||||
-- Update the large table shard count for all the following tests.
|
-- Update the large table shard count for all the following tests.
|
||||||
SET citusdb.large_table_shard_count TO 1;
|
SET citus.large_table_shard_count TO 1;
|
||||||
-- Validate that we don't use a single-partition join method for a hash
|
-- Validate that we don't use a single-partition join method for a hash
|
||||||
-- re-partitioned table, thus preventing a partition of just the customer table.
|
-- re-partitioned table, thus preventing a partition of just the customer table.
|
||||||
EXPLAIN SELECT count(*) FROM orders, lineitem, customer
|
EXPLAIN SELECT count(*) FROM orders, lineitem, customer
|
||||||
|
|
|
@ -2,13 +2,13 @@
|
||||||
-- MULTI_JOIN_ORDER_TPCH_LARGE
|
-- MULTI_JOIN_ORDER_TPCH_LARGE
|
||||||
--
|
--
|
||||||
-- Enable configuration to print table join order
|
-- Enable configuration to print table join order
|
||||||
SET citusdb.log_multi_join_order TO TRUE;
|
SET citus.log_multi_join_order TO TRUE;
|
||||||
SET client_min_messages TO LOG;
|
SET client_min_messages TO LOG;
|
||||||
-- Change configuration to treat lineitem, orders, customer, and part tables as
|
-- Change configuration to treat lineitem, orders, customer, and part tables as
|
||||||
-- large. The following queries are basically the same as the ones in tpch_small
|
-- large. The following queries are basically the same as the ones in tpch_small
|
||||||
-- except that more data has been staged to customer and part tables. Therefore,
|
-- except that more data has been staged to customer and part tables. Therefore,
|
||||||
-- we will apply different distributed join strategies for these queries.
|
-- we will apply different distributed join strategies for these queries.
|
||||||
SET citusdb.large_table_shard_count TO 2;
|
SET citus.large_table_shard_count TO 2;
|
||||||
-- Query #6 from the TPC-H decision support benchmark
|
-- Query #6 from the TPC-H decision support benchmark
|
||||||
EXPLAIN SELECT
|
EXPLAIN SELECT
|
||||||
sum(l_extendedprice * l_discount) as revenue
|
sum(l_extendedprice * l_discount) as revenue
|
||||||
|
|
|
@ -2,10 +2,10 @@
|
||||||
-- MULTI_JOIN_ORDER_TPCH_SMALL
|
-- MULTI_JOIN_ORDER_TPCH_SMALL
|
||||||
--
|
--
|
||||||
-- Enable configuration to print table join order
|
-- Enable configuration to print table join order
|
||||||
SET citusdb.log_multi_join_order TO TRUE;
|
SET citus.log_multi_join_order TO TRUE;
|
||||||
SET client_min_messages TO LOG;
|
SET client_min_messages TO LOG;
|
||||||
-- Change configuration to treat lineitem and orders tables as large
|
-- Change configuration to treat lineitem and orders tables as large
|
||||||
SET citusdb.large_table_shard_count TO 2;
|
SET citus.large_table_shard_count TO 2;
|
||||||
-- Query #6 from the TPC-H decision support benchmark
|
-- Query #6 from the TPC-H decision support benchmark
|
||||||
EXPLAIN SELECT
|
EXPLAIN SELECT
|
||||||
sum(l_extendedprice * l_discount) as revenue
|
sum(l_extendedprice * l_discount) as revenue
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
-- future we want to check for pruning between re-partitioned relations as well.
|
-- future we want to check for pruning between re-partitioned relations as well.
|
||||||
SET client_min_messages TO DEBUG2;
|
SET client_min_messages TO DEBUG2;
|
||||||
-- Change configuration to treat all tables as large
|
-- Change configuration to treat all tables as large
|
||||||
SET citusdb.large_table_shard_count TO 2;
|
SET citus.large_table_shard_count TO 2;
|
||||||
SELECT sum(l_linenumber), avg(l_linenumber) FROM lineitem, orders
|
SELECT sum(l_linenumber), avg(l_linenumber) FROM lineitem, orders
|
||||||
WHERE l_orderkey = o_orderkey;
|
WHERE l_orderkey = o_orderkey;
|
||||||
DEBUG: join prunable for intervals [13921,14947] and [1,5986]
|
DEBUG: join prunable for intervals [13921,14947] and [1,5986]
|
||||||
|
|
|
@ -8,11 +8,11 @@
|
||||||
BEGIN;
|
BEGIN;
|
||||||
SET client_min_messages TO DEBUG4;
|
SET client_min_messages TO DEBUG4;
|
||||||
DEBUG: CommitTransactionCommand
|
DEBUG: CommitTransactionCommand
|
||||||
SET citusdb.large_table_shard_count TO 2;
|
SET citus.large_table_shard_count TO 2;
|
||||||
DEBUG: StartTransactionCommand
|
DEBUG: StartTransactionCommand
|
||||||
DEBUG: ProcessUtility
|
DEBUG: ProcessUtility
|
||||||
DEBUG: CommitTransactionCommand
|
DEBUG: CommitTransactionCommand
|
||||||
SET citusdb.task_executor_type TO 'task-tracker';
|
SET citus.task_executor_type TO 'task-tracker';
|
||||||
DEBUG: StartTransactionCommand
|
DEBUG: StartTransactionCommand
|
||||||
DEBUG: ProcessUtility
|
DEBUG: ProcessUtility
|
||||||
DEBUG: CommitTransactionCommand
|
DEBUG: CommitTransactionCommand
|
||||||
|
|
|
@ -8,11 +8,11 @@
|
||||||
BEGIN;
|
BEGIN;
|
||||||
SET client_min_messages TO DEBUG4;
|
SET client_min_messages TO DEBUG4;
|
||||||
DEBUG: CommitTransactionCommand
|
DEBUG: CommitTransactionCommand
|
||||||
SET citusdb.large_table_shard_count TO 2;
|
SET citus.large_table_shard_count TO 2;
|
||||||
DEBUG: StartTransactionCommand
|
DEBUG: StartTransactionCommand
|
||||||
DEBUG: ProcessUtility
|
DEBUG: ProcessUtility
|
||||||
DEBUG: CommitTransactionCommand
|
DEBUG: CommitTransactionCommand
|
||||||
SET citusdb.task_executor_type TO 'task-tracker';
|
SET citus.task_executor_type TO 'task-tracker';
|
||||||
DEBUG: StartTransactionCommand
|
DEBUG: StartTransactionCommand
|
||||||
DEBUG: ProcessUtility
|
DEBUG: ProcessUtility
|
||||||
DEBUG: CommitTransactionCommand
|
DEBUG: CommitTransactionCommand
|
||||||
|
|
|
@ -4,9 +4,9 @@
|
||||||
-- Tests covering partition and join-pruning for large table joins. Note that we
|
-- Tests covering partition and join-pruning for large table joins. Note that we
|
||||||
-- set executor type to task tracker executor here, as we cannot run repartition
|
-- set executor type to task tracker executor here, as we cannot run repartition
|
||||||
-- jobs with real time executor.
|
-- jobs with real time executor.
|
||||||
SET citusdb.large_table_shard_count TO 2;
|
SET citus.large_table_shard_count TO 2;
|
||||||
SET client_min_messages TO DEBUG2;
|
SET client_min_messages TO DEBUG2;
|
||||||
SET citusdb.task_executor_type TO 'task-tracker';
|
SET citus.task_executor_type TO 'task-tracker';
|
||||||
-- Single range-repartition join to test join-pruning behaviour.
|
-- Single range-repartition join to test join-pruning behaviour.
|
||||||
SELECT
|
SELECT
|
||||||
count(*)
|
count(*)
|
||||||
|
|
|
@ -8,11 +8,11 @@
|
||||||
BEGIN;
|
BEGIN;
|
||||||
SET client_min_messages TO DEBUG3;
|
SET client_min_messages TO DEBUG3;
|
||||||
DEBUG: CommitTransactionCommand
|
DEBUG: CommitTransactionCommand
|
||||||
SET citusdb.large_table_shard_count TO 2;
|
SET citus.large_table_shard_count TO 2;
|
||||||
DEBUG: StartTransactionCommand
|
DEBUG: StartTransactionCommand
|
||||||
DEBUG: ProcessUtility
|
DEBUG: ProcessUtility
|
||||||
DEBUG: CommitTransactionCommand
|
DEBUG: CommitTransactionCommand
|
||||||
SET citusdb.task_executor_type TO 'task-tracker';
|
SET citus.task_executor_type TO 'task-tracker';
|
||||||
DEBUG: StartTransactionCommand
|
DEBUG: StartTransactionCommand
|
||||||
DEBUG: ProcessUtility
|
DEBUG: ProcessUtility
|
||||||
DEBUG: CommitTransactionCommand
|
DEBUG: CommitTransactionCommand
|
||||||
|
@ -52,7 +52,7 @@ DEBUG: CommitTransactionCommand
|
||||||
-- more than one shard. This situation results in multiple sql tasks depending on
|
-- more than one shard. This situation results in multiple sql tasks depending on
|
||||||
-- the same merge task, and tests our constraint group creation and assignment
|
-- the same merge task, and tests our constraint group creation and assignment
|
||||||
-- propagation. Here 'orders' is considered the small table.
|
-- propagation. Here 'orders' is considered the small table.
|
||||||
SET citusdb.large_table_shard_count TO 3;
|
SET citus.large_table_shard_count TO 3;
|
||||||
DEBUG: StartTransactionCommand
|
DEBUG: StartTransactionCommand
|
||||||
DEBUG: ProcessUtility
|
DEBUG: ProcessUtility
|
||||||
DEBUG: CommitTransactionCommand
|
DEBUG: CommitTransactionCommand
|
||||||
|
@ -128,7 +128,7 @@ DEBUG: CommitTransactionCommand
|
||||||
11998
|
11998
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
SET citusdb.large_table_shard_count TO 2;
|
SET citus.large_table_shard_count TO 2;
|
||||||
DEBUG: StartTransactionCommand
|
DEBUG: StartTransactionCommand
|
||||||
DEBUG: ProcessUtility
|
DEBUG: ProcessUtility
|
||||||
DEBUG: CommitTransactionCommand
|
DEBUG: CommitTransactionCommand
|
||||||
|
|
|
@ -24,7 +24,7 @@ SELECT l_partkey, sum(l_partkey * (1 + l_suppkey)) AS aggregate FROM lineitem
|
||||||
(10 rows)
|
(10 rows)
|
||||||
|
|
||||||
-- Enable limit optimization to fetch one third of each shard's data
|
-- Enable limit optimization to fetch one third of each shard's data
|
||||||
SET citusdb.limit_clause_row_fetch_count TO 600;
|
SET citus.limit_clause_row_fetch_count TO 600;
|
||||||
SELECT l_partkey, sum(l_partkey * (1 + l_suppkey)) AS aggregate FROM lineitem
|
SELECT l_partkey, sum(l_partkey * (1 + l_suppkey)) AS aggregate FROM lineitem
|
||||||
GROUP BY l_partkey
|
GROUP BY l_partkey
|
||||||
ORDER BY aggregate DESC LIMIT 10;
|
ORDER BY aggregate DESC LIMIT 10;
|
||||||
|
@ -45,7 +45,7 @@ DEBUG: push down of limit count: 600
|
||||||
|
|
||||||
-- Disable limit optimization for our second test. This time, we have a query
|
-- Disable limit optimization for our second test. This time, we have a query
|
||||||
-- that joins several tables, and that groups and orders the results.
|
-- that joins several tables, and that groups and orders the results.
|
||||||
RESET citusdb.limit_clause_row_fetch_count;
|
RESET citus.limit_clause_row_fetch_count;
|
||||||
SELECT c_custkey, c_name, count(*) as lineitem_count
|
SELECT c_custkey, c_name, count(*) as lineitem_count
|
||||||
FROM customer, orders, lineitem
|
FROM customer, orders, lineitem
|
||||||
WHERE c_custkey = o_custkey AND l_orderkey = o_orderkey
|
WHERE c_custkey = o_custkey AND l_orderkey = o_orderkey
|
||||||
|
@ -68,8 +68,8 @@ SELECT c_custkey, c_name, count(*) as lineitem_count
|
||||||
-- Now, enable limit optimization to fetch half of each task's results. For this
|
-- Now, enable limit optimization to fetch half of each task's results. For this
|
||||||
-- test, we also change a config setting to ensure that we don't repartition any
|
-- test, we also change a config setting to ensure that we don't repartition any
|
||||||
-- of the tables during the query.
|
-- of the tables during the query.
|
||||||
SET citusdb.limit_clause_row_fetch_count TO 150;
|
SET citus.limit_clause_row_fetch_count TO 150;
|
||||||
SET citusdb.large_table_shard_count TO 2;
|
SET citus.large_table_shard_count TO 2;
|
||||||
SELECT c_custkey, c_name, count(*) as lineitem_count
|
SELECT c_custkey, c_name, count(*) as lineitem_count
|
||||||
FROM customer, orders, lineitem
|
FROM customer, orders, lineitem
|
||||||
WHERE c_custkey = o_custkey AND l_orderkey = o_orderkey
|
WHERE c_custkey = o_custkey AND l_orderkey = o_orderkey
|
||||||
|
@ -90,7 +90,7 @@ DEBUG: push down of limit count: 150
|
||||||
145 | Customer#000000145 | 30
|
145 | Customer#000000145 | 30
|
||||||
(10 rows)
|
(10 rows)
|
||||||
|
|
||||||
RESET citusdb.large_table_shard_count;
|
RESET citus.large_table_shard_count;
|
||||||
-- We now test scenarios where applying the limit optimization wouldn't produce
|
-- We now test scenarios where applying the limit optimization wouldn't produce
|
||||||
-- meaningful results. First, we check that we don't push down the limit clause
|
-- meaningful results. First, we check that we don't push down the limit clause
|
||||||
-- for non-commutative aggregates.
|
-- for non-commutative aggregates.
|
||||||
|
@ -147,5 +147,5 @@ SELECT count(*) count_quantity, l_quantity FROM lineitem WHERE l_quantity < 10.0
|
||||||
258 | 9.00
|
258 | 9.00
|
||||||
(9 rows)
|
(9 rows)
|
||||||
|
|
||||||
RESET citusdb.limit_clause_row_fetch_count;
|
RESET citus.limit_clause_row_fetch_count;
|
||||||
RESET client_min_messages;
|
RESET client_min_messages;
|
||||||
|
|
|
@ -91,7 +91,7 @@ INSERT INTO append_partitioned VALUES (414123, 'AAPL', 9580, '2004-10-19 10:23:5
|
||||||
20.69);
|
20.69);
|
||||||
-- ensure the values are where we put them and query to ensure they are properly pruned
|
-- ensure the values are where we put them and query to ensure they are properly pruned
|
||||||
SET client_min_messages TO 'DEBUG2';
|
SET client_min_messages TO 'DEBUG2';
|
||||||
SET citusdb.task_executor_type TO 'router';
|
SET citus.task_executor_type TO 'router';
|
||||||
SELECT * FROM range_partitioned WHERE id = 32743;
|
SELECT * FROM range_partitioned WHERE id = 32743;
|
||||||
DEBUG: predicate pruning for shardId 103070
|
DEBUG: predicate pruning for shardId 103070
|
||||||
id | symbol | bidder_id | placed_at | kind | limit_price
|
id | symbol | bidder_id | placed_at | kind | limit_price
|
||||||
|
@ -107,7 +107,7 @@ DEBUG: predicate pruning for shardId 103072
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
SET client_min_messages TO DEFAULT;
|
SET client_min_messages TO DEFAULT;
|
||||||
SET citusdb.task_executor_type TO DEFAULT;
|
SET citus.task_executor_type TO DEFAULT;
|
||||||
-- try inserting without a range-partitioned shard to receive the value
|
-- try inserting without a range-partitioned shard to receive the value
|
||||||
INSERT INTO range_partitioned VALUES (999999, 'AAPL', 9580, '2004-10-19 10:23:54', 'buy',
|
INSERT INTO range_partitioned VALUES (999999, 'AAPL', 9580, '2004-10-19 10:23:54', 'buy',
|
||||||
20.69);
|
20.69);
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
-- and that we don't partition or join prune shards that have null values.
|
-- and that we don't partition or join prune shards that have null values.
|
||||||
SET client_min_messages TO DEBUG2;
|
SET client_min_messages TO DEBUG2;
|
||||||
-- Change configuration to treat lineitem and orders tables as large
|
-- Change configuration to treat lineitem and orders tables as large
|
||||||
SET citusdb.large_table_shard_count TO 2;
|
SET citus.large_table_shard_count TO 2;
|
||||||
SELECT shardminvalue, shardmaxvalue from pg_dist_shard WHERE shardid = 102009;
|
SELECT shardminvalue, shardmaxvalue from pg_dist_shard WHERE shardid = 102009;
|
||||||
shardminvalue | shardmaxvalue
|
shardminvalue | shardmaxvalue
|
||||||
---------------+---------------
|
---------------+---------------
|
||||||
|
|
|
@ -173,7 +173,7 @@ BEGIN
|
||||||
l_year;
|
l_year;
|
||||||
END;
|
END;
|
||||||
$$ LANGUAGE plpgsql;
|
$$ LANGUAGE plpgsql;
|
||||||
SET citusdb.task_executor_type TO 'task-tracker';
|
SET citus.task_executor_type TO 'task-tracker';
|
||||||
SET client_min_messages TO INFO;
|
SET client_min_messages TO INFO;
|
||||||
-- now, run plain SQL functions
|
-- now, run plain SQL functions
|
||||||
SELECT sql_test_no_1();
|
SELECT sql_test_no_1();
|
||||||
|
@ -313,7 +313,7 @@ SELECT plpgsql_test_2();
|
||||||
|
|
||||||
-- run the tests which do not require re-partition
|
-- run the tests which do not require re-partition
|
||||||
-- with real-time executor
|
-- with real-time executor
|
||||||
SET citusdb.task_executor_type TO 'real-time';
|
SET citus.task_executor_type TO 'real-time';
|
||||||
-- now, run plain SQL functions
|
-- now, run plain SQL functions
|
||||||
SELECT sql_test_no_1();
|
SELECT sql_test_no_1();
|
||||||
sql_test_no_1
|
sql_test_no_1
|
||||||
|
|
|
@ -95,7 +95,7 @@ ORDER BY
|
||||||
supp_nation,
|
supp_nation,
|
||||||
cust_nation,
|
cust_nation,
|
||||||
l_year;
|
l_year;
|
||||||
SET citusdb.task_executor_type TO 'task-tracker';
|
SET citus.task_executor_type TO 'task-tracker';
|
||||||
SET client_min_messages TO INFO;
|
SET client_min_messages TO INFO;
|
||||||
-- execute prepared statements
|
-- execute prepared statements
|
||||||
EXECUTE prepared_test_1;
|
EXECUTE prepared_test_1;
|
||||||
|
@ -217,7 +217,7 @@ SELECT * from prepared_sql_test_7;
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
-- now, run some of the tests with real-time executor
|
-- now, run some of the tests with real-time executor
|
||||||
SET citusdb.task_executor_type TO 'real-time';
|
SET citus.task_executor_type TO 'real-time';
|
||||||
-- execute prepared statements
|
-- execute prepared statements
|
||||||
EXECUTE prepared_test_1;
|
EXECUTE prepared_test_1;
|
||||||
count
|
count
|
||||||
|
|
|
@ -3,23 +3,23 @@
|
||||||
-- ===================================================================
|
-- ===================================================================
|
||||||
CREATE FUNCTION prune_using_no_values(regclass)
|
CREATE FUNCTION prune_using_no_values(regclass)
|
||||||
RETURNS text[]
|
RETURNS text[]
|
||||||
AS 'citusdb'
|
AS 'citus'
|
||||||
LANGUAGE C STRICT;
|
LANGUAGE C STRICT;
|
||||||
CREATE FUNCTION prune_using_single_value(regclass, text)
|
CREATE FUNCTION prune_using_single_value(regclass, text)
|
||||||
RETURNS text[]
|
RETURNS text[]
|
||||||
AS 'citusdb'
|
AS 'citus'
|
||||||
LANGUAGE C;
|
LANGUAGE C;
|
||||||
CREATE FUNCTION prune_using_either_value(regclass, text, text)
|
CREATE FUNCTION prune_using_either_value(regclass, text, text)
|
||||||
RETURNS text[]
|
RETURNS text[]
|
||||||
AS 'citusdb'
|
AS 'citus'
|
||||||
LANGUAGE C STRICT;
|
LANGUAGE C STRICT;
|
||||||
CREATE FUNCTION prune_using_both_values(regclass, text, text)
|
CREATE FUNCTION prune_using_both_values(regclass, text, text)
|
||||||
RETURNS text[]
|
RETURNS text[]
|
||||||
AS 'citusdb'
|
AS 'citus'
|
||||||
LANGUAGE C STRICT;
|
LANGUAGE C STRICT;
|
||||||
CREATE FUNCTION debug_equality_expression(regclass)
|
CREATE FUNCTION debug_equality_expression(regclass)
|
||||||
RETURNS cstring
|
RETURNS cstring
|
||||||
AS 'citusdb'
|
AS 'citus'
|
||||||
LANGUAGE C STRICT;
|
LANGUAGE C STRICT;
|
||||||
-- ===================================================================
|
-- ===================================================================
|
||||||
-- test shard pruning functionality
|
-- test shard pruning functionality
|
||||||
|
|
|
@ -169,7 +169,7 @@ SELECT title, author_id FROM articles
|
||||||
(10 rows)
|
(10 rows)
|
||||||
|
|
||||||
-- add in some grouping expressions, still on same shard
|
-- add in some grouping expressions, still on same shard
|
||||||
-- having queries unsupported in CitusDB
|
-- having queries unsupported in Citus
|
||||||
SELECT author_id, sum(word_count) AS corpus_size FROM articles
|
SELECT author_id, sum(word_count) AS corpus_size FROM articles
|
||||||
WHERE author_id = 1 OR author_id = 7 OR author_id = 8 OR author_id = 10
|
WHERE author_id = 1 OR author_id = 7 OR author_id = 8 OR author_id = 10
|
||||||
GROUP BY author_id
|
GROUP BY author_id
|
||||||
|
@ -190,7 +190,7 @@ ERROR: cannot plan queries that include both regular and partitioned relations
|
||||||
SELECT * FROM articles, position('om' in 'Thomas');
|
SELECT * FROM articles, position('om' in 'Thomas');
|
||||||
ERROR: cannot perform distributed planning on this query
|
ERROR: cannot perform distributed planning on this query
|
||||||
DETAIL: Complex table expressions are currently unsupported
|
DETAIL: Complex table expressions are currently unsupported
|
||||||
-- subqueries are not supported in WHERE clause in CitusDB
|
-- subqueries are not supported in WHERE clause in Citus
|
||||||
SELECT * FROM articles WHERE author_id IN (SELECT id FROM authors WHERE name LIKE '%a');
|
SELECT * FROM articles WHERE author_id IN (SELECT id FROM authors WHERE name LIKE '%a');
|
||||||
ERROR: cannot plan queries that include both regular and partitioned relations
|
ERROR: cannot plan queries that include both regular and partitioned relations
|
||||||
-- subqueries are supported in FROM clause
|
-- subqueries are supported in FROM clause
|
||||||
|
@ -285,7 +285,7 @@ SELECT COUNT(*) FROM articles;
|
||||||
50
|
50
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
-- having queries unsupported in CitusDB
|
-- having queries unsupported in Citus
|
||||||
SELECT author_id, sum(word_count) AS corpus_size FROM articles
|
SELECT author_id, sum(word_count) AS corpus_size FROM articles
|
||||||
GROUP BY author_id
|
GROUP BY author_id
|
||||||
HAVING sum(word_count) > 25000
|
HAVING sum(word_count) > 25000
|
||||||
|
@ -293,17 +293,17 @@ SELECT author_id, sum(word_count) AS corpus_size FROM articles
|
||||||
LIMIT 5;
|
LIMIT 5;
|
||||||
ERROR: cannot perform distributed planning on this query
|
ERROR: cannot perform distributed planning on this query
|
||||||
DETAIL: Having qual is currently unsupported
|
DETAIL: Having qual is currently unsupported
|
||||||
-- more proof CitusDB doesn't support having clauses
|
-- more proof Citus doesn't support having clauses
|
||||||
SELECT author_id FROM articles
|
SELECT author_id FROM articles
|
||||||
GROUP BY author_id
|
GROUP BY author_id
|
||||||
HAVING sum(word_count) > 50000
|
HAVING sum(word_count) > 50000
|
||||||
ORDER BY author_id;
|
ORDER BY author_id;
|
||||||
ERROR: cannot perform distributed planning on this query
|
ERROR: cannot perform distributed planning on this query
|
||||||
DETAIL: Having qual is currently unsupported
|
DETAIL: Having qual is currently unsupported
|
||||||
-- now, test the cases where CitusDB do or do not need to create
|
-- now, test the cases where Citus do or do not need to create
|
||||||
-- the master queries
|
-- the master queries
|
||||||
SET citusdb.task_executor_type TO 'router';
|
SET citus.task_executor_type TO 'router';
|
||||||
SET citusdb.large_table_shard_count TO 2;
|
SET citus.large_table_shard_count TO 2;
|
||||||
SET client_min_messages TO 'DEBUG2';
|
SET client_min_messages TO 'DEBUG2';
|
||||||
-- start with the simple lookup query
|
-- start with the simple lookup query
|
||||||
SELECT *
|
SELECT *
|
||||||
|
@ -338,7 +338,7 @@ SELECT *
|
||||||
FROM articles
|
FROM articles
|
||||||
WHERE author_id = 1 OR author_id = 18;
|
WHERE author_id = 1 OR author_id = 18;
|
||||||
ERROR: cannot use router executor with queries that hit multiple shards
|
ERROR: cannot use router executor with queries that hit multiple shards
|
||||||
HINT: Set citusdb.task_executor_type to "real-time" or "task-tracker".
|
HINT: Set citus.task_executor_type to "real-time" or "task-tracker".
|
||||||
-- rename the output columns on a no master query case
|
-- rename the output columns on a no master query case
|
||||||
SELECT id as article_id, word_count * id as random_value
|
SELECT id as article_id, word_count * id as random_value
|
||||||
FROM articles
|
FROM articles
|
||||||
|
@ -377,7 +377,7 @@ SELECT a.author_id as first_author, b.word_count as second_word_count
|
||||||
DEBUG: push down of limit count: 3
|
DEBUG: push down of limit count: 3
|
||||||
DEBUG: predicate pruning for shardId 103094
|
DEBUG: predicate pruning for shardId 103094
|
||||||
ERROR: cannot use router executor with JOINs
|
ERROR: cannot use router executor with JOINs
|
||||||
HINT: Set citusdb.task_executor_type to "real-time" or "task-tracker".
|
HINT: Set citus.task_executor_type to "real-time" or "task-tracker".
|
||||||
-- do not create the master query for LIMIT on a single shard SELECT
|
-- do not create the master query for LIMIT on a single shard SELECT
|
||||||
SELECT *
|
SELECT *
|
||||||
FROM articles
|
FROM articles
|
||||||
|
@ -417,7 +417,7 @@ SELECT avg(word_count)
|
||||||
WHERE author_id = 2;
|
WHERE author_id = 2;
|
||||||
DEBUG: predicate pruning for shardId 103093
|
DEBUG: predicate pruning for shardId 103093
|
||||||
ERROR: cannot use router executor with aggregates
|
ERROR: cannot use router executor with aggregates
|
||||||
HINT: Set citusdb.task_executor_type to "real-time" or "task-tracker".
|
HINT: Set citus.task_executor_type to "real-time" or "task-tracker".
|
||||||
-- max, min, sum, count is somehow implemented
|
-- max, min, sum, count is somehow implemented
|
||||||
-- differently in distributed planning but, still error out
|
-- differently in distributed planning but, still error out
|
||||||
SELECT max(word_count) as max, min(word_count) as min,
|
SELECT max(word_count) as max, min(word_count) as min,
|
||||||
|
@ -426,7 +426,7 @@ SELECT max(word_count) as max, min(word_count) as min,
|
||||||
WHERE author_id = 2;
|
WHERE author_id = 2;
|
||||||
DEBUG: predicate pruning for shardId 103093
|
DEBUG: predicate pruning for shardId 103093
|
||||||
ERROR: cannot use router executor with aggregates
|
ERROR: cannot use router executor with aggregates
|
||||||
HINT: Set citusdb.task_executor_type to "real-time" or "task-tracker".
|
HINT: Set citus.task_executor_type to "real-time" or "task-tracker".
|
||||||
-- error out for queries with ORDER BY
|
-- error out for queries with ORDER BY
|
||||||
SELECT *
|
SELECT *
|
||||||
FROM articles
|
FROM articles
|
||||||
|
@ -434,7 +434,7 @@ SELECT *
|
||||||
ORDER BY word_count;
|
ORDER BY word_count;
|
||||||
DEBUG: predicate pruning for shardId 103094
|
DEBUG: predicate pruning for shardId 103094
|
||||||
ERROR: cannot use router executor with ORDER BY clauses
|
ERROR: cannot use router executor with ORDER BY clauses
|
||||||
HINT: Set citusdb.task_executor_type to "real-time" or "task-tracker".
|
HINT: Set citus.task_executor_type to "real-time" or "task-tracker".
|
||||||
-- error out for queries with ORDER BY and LIMIT
|
-- error out for queries with ORDER BY and LIMIT
|
||||||
SELECT *
|
SELECT *
|
||||||
FROM articles
|
FROM articles
|
||||||
|
@ -444,7 +444,7 @@ SELECT *
|
||||||
DEBUG: push down of limit count: 2
|
DEBUG: push down of limit count: 2
|
||||||
DEBUG: predicate pruning for shardId 103094
|
DEBUG: predicate pruning for shardId 103094
|
||||||
ERROR: cannot use router executor with ORDER BY clauses
|
ERROR: cannot use router executor with ORDER BY clauses
|
||||||
HINT: Set citusdb.task_executor_type to "real-time" or "task-tracker".
|
HINT: Set citus.task_executor_type to "real-time" or "task-tracker".
|
||||||
-- error out for queries with aggregates and GROUP BY
|
-- error out for queries with aggregates and GROUP BY
|
||||||
SELECT max(word_count)
|
SELECT max(word_count)
|
||||||
FROM articles
|
FROM articles
|
||||||
|
@ -452,7 +452,7 @@ SELECT max(word_count)
|
||||||
GROUP BY author_id;
|
GROUP BY author_id;
|
||||||
DEBUG: predicate pruning for shardId 103094
|
DEBUG: predicate pruning for shardId 103094
|
||||||
ERROR: cannot use router executor with aggregates
|
ERROR: cannot use router executor with aggregates
|
||||||
HINT: Set citusdb.task_executor_type to "real-time" or "task-tracker".
|
HINT: Set citus.task_executor_type to "real-time" or "task-tracker".
|
||||||
-- error out for queries with repartition jobs
|
-- error out for queries with repartition jobs
|
||||||
SELECT *
|
SELECT *
|
||||||
FROM articles a, articles b
|
FROM articles a, articles b
|
||||||
|
@ -487,12 +487,12 @@ DETAIL: Creating dependency on merge taskId 9
|
||||||
DEBUG: pruning merge fetch taskId 11
|
DEBUG: pruning merge fetch taskId 11
|
||||||
DETAIL: Creating dependency on merge taskId 14
|
DETAIL: Creating dependency on merge taskId 14
|
||||||
ERROR: cannot use router executor with repartition jobs
|
ERROR: cannot use router executor with repartition jobs
|
||||||
HINT: Set citusdb.task_executor_type to "task-tracker".
|
HINT: Set citus.task_executor_type to "task-tracker".
|
||||||
-- error out for queries which hit more than 1 shards
|
-- error out for queries which hit more than 1 shards
|
||||||
SELECT *
|
SELECT *
|
||||||
FROM articles
|
FROM articles
|
||||||
WHERE author_id >= 1 AND author_id <= 3;
|
WHERE author_id >= 1 AND author_id <= 3;
|
||||||
ERROR: cannot use router executor with queries that hit multiple shards
|
ERROR: cannot use router executor with queries that hit multiple shards
|
||||||
HINT: Set citusdb.task_executor_type to "real-time" or "task-tracker".
|
HINT: Set citus.task_executor_type to "real-time" or "task-tracker".
|
||||||
SET client_min_messages to 'NOTICE';
|
SET client_min_messages to 'NOTICE';
|
||||||
SET citusdb.task_executor_type TO 'real-time';
|
SET citus.task_executor_type TO 'real-time';
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
-- MULTI_SINGLE_RELATION_SUBQUERY
|
-- MULTI_SINGLE_RELATION_SUBQUERY
|
||||||
--
|
--
|
||||||
-- This test checks that we are able to run selected set of distributed SQL subqueries.
|
-- This test checks that we are able to run selected set of distributed SQL subqueries.
|
||||||
SET citusdb.task_executor_type TO 'task-tracker';
|
SET citus.task_executor_type TO 'task-tracker';
|
||||||
select
|
select
|
||||||
number_sum,
|
number_sum,
|
||||||
count(*) as total,
|
count(*) as total,
|
||||||
|
|
|
@ -9,12 +9,12 @@ SELECT master_create_distributed_table('testtableddl', 'distributecol', 'append'
|
||||||
|
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
-- verify that the citusdb extension can't be dropped while distributed tables exist
|
-- verify that the citus extension can't be dropped while distributed tables exist
|
||||||
DROP EXTENSION citusdb;
|
DROP EXTENSION citus;
|
||||||
WARNING: could not clean the metadata cache on DROP EXTENSION command
|
WARNING: could not clean the metadata cache on DROP EXTENSION command
|
||||||
HINT: Reconnect to the server again.
|
HINT: Reconnect to the server again.
|
||||||
ERROR: cannot drop extension citusdb because other objects depend on it
|
ERROR: cannot drop extension citus because other objects depend on it
|
||||||
DETAIL: table testtableddl depends on extension citusdb
|
DETAIL: table testtableddl depends on extension citus
|
||||||
HINT: Use DROP ... CASCADE to drop the dependent objects too.
|
HINT: Use DROP ... CASCADE to drop the dependent objects too.
|
||||||
-- verify that the distribution column can't have its type changed
|
-- verify that the distribution column can't have its type changed
|
||||||
ALTER TABLE testtableddl ALTER COLUMN distributecol TYPE text;
|
ALTER TABLE testtableddl ALTER COLUMN distributecol TYPE text;
|
||||||
|
@ -63,8 +63,8 @@ SELECT * FROM pg_dist_shard_placement;
|
||||||
-- check that the extension now can be dropped (and recreated). We reconnect
|
-- check that the extension now can be dropped (and recreated). We reconnect
|
||||||
-- before creating the extension to expire extension specific variables which
|
-- before creating the extension to expire extension specific variables which
|
||||||
-- are cached for performance.
|
-- are cached for performance.
|
||||||
DROP EXTENSION citusdb;
|
DROP EXTENSION citus;
|
||||||
WARNING: could not clean the metadata cache on DROP EXTENSION command
|
WARNING: could not clean the metadata cache on DROP EXTENSION command
|
||||||
HINT: Reconnect to the server again.
|
HINT: Reconnect to the server again.
|
||||||
\c
|
\c
|
||||||
CREATE EXTENSION citusdb;
|
CREATE EXTENSION citus;
|
||||||
|
|
|
@ -46,7 +46,7 @@ BEGIN;
|
||||||
SET client_min_messages TO DEBUG3;
|
SET client_min_messages TO DEBUG3;
|
||||||
DEBUG: CommitTransactionCommand
|
DEBUG: CommitTransactionCommand
|
||||||
-- First test the default greedy task assignment policy
|
-- First test the default greedy task assignment policy
|
||||||
SET citusdb.task_assignment_policy TO 'greedy';
|
SET citus.task_assignment_policy TO 'greedy';
|
||||||
DEBUG: StartTransactionCommand
|
DEBUG: StartTransactionCommand
|
||||||
DEBUG: ProcessUtility
|
DEBUG: ProcessUtility
|
||||||
DEBUG: CommitTransactionCommand
|
DEBUG: CommitTransactionCommand
|
||||||
|
@ -75,7 +75,7 @@ DEBUG: CommitTransactionCommand
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
-- Next test the first-replica task assignment policy
|
-- Next test the first-replica task assignment policy
|
||||||
SET citusdb.task_assignment_policy TO 'first-replica';
|
SET citus.task_assignment_policy TO 'first-replica';
|
||||||
DEBUG: StartTransactionCommand
|
DEBUG: StartTransactionCommand
|
||||||
DEBUG: ProcessUtility
|
DEBUG: ProcessUtility
|
||||||
DEBUG: CommitTransactionCommand
|
DEBUG: CommitTransactionCommand
|
||||||
|
@ -118,7 +118,7 @@ DEBUG: CommitTransactionCommand
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
-- Finally test the round-robin task assignment policy
|
-- Finally test the round-robin task assignment policy
|
||||||
SET citusdb.task_assignment_policy TO 'round-robin';
|
SET citus.task_assignment_policy TO 'round-robin';
|
||||||
DEBUG: StartTransactionCommand
|
DEBUG: StartTransactionCommand
|
||||||
DEBUG: ProcessUtility
|
DEBUG: ProcessUtility
|
||||||
DEBUG: CommitTransactionCommand
|
DEBUG: CommitTransactionCommand
|
||||||
|
@ -158,7 +158,7 @@ DEBUG: CommitTransactionCommand
|
||||||
explain statements for distributed queries are currently unsupported
|
explain statements for distributed queries are currently unsupported
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
RESET citusdb.task_assignment_policy;
|
RESET citus.task_assignment_policy;
|
||||||
DEBUG: StartTransactionCommand
|
DEBUG: StartTransactionCommand
|
||||||
DEBUG: ProcessUtility
|
DEBUG: ProcessUtility
|
||||||
DEBUG: CommitTransactionCommand
|
DEBUG: CommitTransactionCommand
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
-- MULTI_TPCH_QUERY1
|
-- MULTI_TPCH_QUERY1
|
||||||
--
|
--
|
||||||
-- Change configuration to treat lineitem and orders tables as large
|
-- Change configuration to treat lineitem and orders tables as large
|
||||||
SET citusdb.large_table_shard_count TO 2;
|
SET citus.large_table_shard_count TO 2;
|
||||||
-- Query #1 from the TPC-H decision support benchmark
|
-- Query #1 from the TPC-H decision support benchmark
|
||||||
SELECT
|
SELECT
|
||||||
l_returnflag,
|
l_returnflag,
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
-- MULTI_TPCH_QUERY10
|
-- MULTI_TPCH_QUERY10
|
||||||
--
|
--
|
||||||
-- Query #10 from the TPC-H decision support benchmark. Unlike other TPC-H tests,
|
-- Query #10 from the TPC-H decision support benchmark. Unlike other TPC-H tests,
|
||||||
-- we don't set citusdb.large_table_shard_count here, and instead use the default value
|
-- we don't set citus.large_table_shard_count here, and instead use the default value
|
||||||
-- coming from postgresql.conf or multi_task_tracker_executor.conf.
|
-- coming from postgresql.conf or multi_task_tracker_executor.conf.
|
||||||
SELECT
|
SELECT
|
||||||
c_custkey,
|
c_custkey,
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
-- MULTI_TPCH_QUERY12
|
-- MULTI_TPCH_QUERY12
|
||||||
--
|
--
|
||||||
-- Change configuration to treat lineitem and orders tables as large
|
-- Change configuration to treat lineitem and orders tables as large
|
||||||
SET citusdb.large_table_shard_count TO 2;
|
SET citus.large_table_shard_count TO 2;
|
||||||
-- Query #12 from the TPC-H decision support benchmark
|
-- Query #12 from the TPC-H decision support benchmark
|
||||||
SELECT
|
SELECT
|
||||||
l_shipmode,
|
l_shipmode,
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
-- MULTI_TPCH_QUERY14
|
-- MULTI_TPCH_QUERY14
|
||||||
--
|
--
|
||||||
-- Change configuration to treat lineitem and orders tables as large
|
-- Change configuration to treat lineitem and orders tables as large
|
||||||
SET citusdb.large_table_shard_count TO 2;
|
SET citus.large_table_shard_count TO 2;
|
||||||
-- Query #14 from the TPC-H decision support benchmark
|
-- Query #14 from the TPC-H decision support benchmark
|
||||||
SELECT
|
SELECT
|
||||||
100.00 * sum(case
|
100.00 * sum(case
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
-- MULTI_TPCH_QUERY19
|
-- MULTI_TPCH_QUERY19
|
||||||
--
|
--
|
||||||
-- Change configuration to treat lineitem and orders tables as large
|
-- Change configuration to treat lineitem and orders tables as large
|
||||||
SET citusdb.large_table_shard_count TO 2;
|
SET citus.large_table_shard_count TO 2;
|
||||||
-- Query #19 from the TPC-H decision support benchmark. Note that we modified
|
-- Query #19 from the TPC-H decision support benchmark. Note that we modified
|
||||||
-- the query from its original to make it work on smaller data sets.
|
-- the query from its original to make it work on smaller data sets.
|
||||||
SELECT
|
SELECT
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
-- MULTI_TPCH_QUERY3
|
-- MULTI_TPCH_QUERY3
|
||||||
--
|
--
|
||||||
-- Query #3 from the TPC-H decision support benchmark. Unlike other TPC-H tests,
|
-- Query #3 from the TPC-H decision support benchmark. Unlike other TPC-H tests,
|
||||||
-- we don't set citusdb.large_table_shard_count here, and instead use the default value
|
-- we don't set citus.large_table_shard_count here, and instead use the default value
|
||||||
-- coming from postgresql.conf or multi_task_tracker_executor.conf.
|
-- coming from postgresql.conf or multi_task_tracker_executor.conf.
|
||||||
SELECT
|
SELECT
|
||||||
l_orderkey,
|
l_orderkey,
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
-- MULTI_TPCH_QUERY6
|
-- MULTI_TPCH_QUERY6
|
||||||
--
|
--
|
||||||
-- Change configuration to treat lineitem and orders tables as large
|
-- Change configuration to treat lineitem and orders tables as large
|
||||||
SET citusdb.large_table_shard_count TO 2;
|
SET citus.large_table_shard_count TO 2;
|
||||||
-- Query #6 from the TPC-H decision support benchmark
|
-- Query #6 from the TPC-H decision support benchmark
|
||||||
SELECT
|
SELECT
|
||||||
sum(l_extendedprice * l_discount) as revenue
|
sum(l_extendedprice * l_discount) as revenue
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
-- MULTI_TPCH_QUERY7
|
-- MULTI_TPCH_QUERY7
|
||||||
--
|
--
|
||||||
-- Change configuration to treat lineitem AND orders tables as large
|
-- Change configuration to treat lineitem AND orders tables as large
|
||||||
SET citusdb.large_table_shard_count TO 2;
|
SET citus.large_table_shard_count TO 2;
|
||||||
-- Query #7 from the TPC-H decision support benchmark
|
-- Query #7 from the TPC-H decision support benchmark
|
||||||
SELECT
|
SELECT
|
||||||
supp_nation,
|
supp_nation,
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
-- MULTI_TPCH_QUERY7_NESTED
|
-- MULTI_TPCH_QUERY7_NESTED
|
||||||
--
|
--
|
||||||
-- Change configuration to treat lineitem AND orders tables AS large
|
-- Change configuration to treat lineitem AND orders tables AS large
|
||||||
SET citusdb.large_table_shard_count TO 2;
|
SET citus.large_table_shard_count TO 2;
|
||||||
-- Query #7 from the TPC-H benchmark; modified to include sub-selects
|
-- Query #7 from the TPC-H benchmark; modified to include sub-selects
|
||||||
SELECT
|
SELECT
|
||||||
supp_nation,
|
supp_nation,
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
-- this test file aims to test UPSERT feature on CitusDB
|
-- this test file aims to test UPSERT feature on Citus
|
||||||
-- note that output of this file for postgresql 9.4 will
|
-- note that output of this file for postgresql 9.4 will
|
||||||
-- be full syntax errors, which is expected.
|
-- be full syntax errors, which is expected.
|
||||||
CREATE TABLE upsert_test
|
CREATE TABLE upsert_test
|
||||||
|
@ -124,7 +124,7 @@ SELECT master_create_worker_shards('upsert_test_2', '4', '2');
|
||||||
|
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
-- now show that CitusDB works with multiple columns as the PRIMARY KEY, including the partiton key
|
-- now show that Citus works with multiple columns as the PRIMARY KEY, including the partiton key
|
||||||
INSERT INTO upsert_test_2 (part_key, other_col) VALUES (1, 1);
|
INSERT INTO upsert_test_2 (part_key, other_col) VALUES (1, 1);
|
||||||
INSERT INTO upsert_test_2 (part_key, other_col) VALUES (1, 1) ON CONFLICT (part_key, other_col) DO NOTHING;
|
INSERT INTO upsert_test_2 (part_key, other_col) VALUES (1, 1) ON CONFLICT (part_key, other_col) DO NOTHING;
|
||||||
-- this errors out since there is no unique constraint on partition key
|
-- this errors out since there is no unique constraint on partition key
|
||||||
|
@ -214,7 +214,7 @@ INSERT INTO dropcol_distributed AS dropcol (key, keep1) VALUES (1, '5') ON CONFL
|
||||||
ALTER TABLE dropcol_distributed DROP COLUMN drop1;
|
ALTER TABLE dropcol_distributed DROP COLUMN drop1;
|
||||||
INSERT INTO dropcol_distributed AS dropcol (key, keep1) VALUES (1, '5') ON CONFLICT(key)
|
INSERT INTO dropcol_distributed AS dropcol (key, keep1) VALUES (1, '5') ON CONFLICT(key)
|
||||||
DO UPDATE SET keep1 = dropcol.keep1;
|
DO UPDATE SET keep1 = dropcol.keep1;
|
||||||
-- below we test the cases that CitusDB does not support
|
-- below we test the cases that Citus does not support
|
||||||
-- subquery in the SET clause
|
-- subquery in the SET clause
|
||||||
INSERT INTO upsert_test (part_key, other_col) VALUES (1, 1) ON CONFLICT (part_key) DO
|
INSERT INTO upsert_test (part_key, other_col) VALUES (1, 1) ON CONFLICT (part_key) DO
|
||||||
UPDATE SET other_col = (SELECT count(*) from upsert_test);
|
UPDATE SET other_col = (SELECT count(*) from upsert_test);
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
-- this test file aims to test UPSERT feature on CitusDB
|
-- this test file aims to test UPSERT feature on Citus
|
||||||
-- note that output of this file for postgresql 9.4 will
|
-- note that output of this file for postgresql 9.4 will
|
||||||
-- be full syntax errors, which is expected.
|
-- be full syntax errors, which is expected.
|
||||||
CREATE TABLE upsert_test
|
CREATE TABLE upsert_test
|
||||||
|
@ -157,7 +157,7 @@ SELECT master_create_worker_shards('upsert_test_2', '4', '2');
|
||||||
|
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
-- now show that CitusDB works with multiple columns as the PRIMARY KEY, including the partiton key
|
-- now show that Citus works with multiple columns as the PRIMARY KEY, including the partiton key
|
||||||
INSERT INTO upsert_test_2 (part_key, other_col) VALUES (1, 1);
|
INSERT INTO upsert_test_2 (part_key, other_col) VALUES (1, 1);
|
||||||
INSERT INTO upsert_test_2 (part_key, other_col) VALUES (1, 1) ON CONFLICT (part_key, other_col) DO NOTHING;
|
INSERT INTO upsert_test_2 (part_key, other_col) VALUES (1, 1) ON CONFLICT (part_key, other_col) DO NOTHING;
|
||||||
ERROR: syntax error at or near "ON"
|
ERROR: syntax error at or near "ON"
|
||||||
|
@ -284,7 +284,7 @@ INSERT INTO dropcol_distributed AS dropcol (key, keep1) VALUES (1, '5') ON CONFL
|
||||||
ERROR: syntax error at or near "AS"
|
ERROR: syntax error at or near "AS"
|
||||||
LINE 1: INSERT INTO dropcol_distributed AS dropcol (key, keep1) VALU...
|
LINE 1: INSERT INTO dropcol_distributed AS dropcol (key, keep1) VALU...
|
||||||
^
|
^
|
||||||
-- below we test the cases that CitusDB does not support
|
-- below we test the cases that Citus does not support
|
||||||
-- subquery in the SET clause
|
-- subquery in the SET clause
|
||||||
INSERT INTO upsert_test (part_key, other_col) VALUES (1, 1) ON CONFLICT (part_key) DO
|
INSERT INTO upsert_test (part_key, other_col) VALUES (1, 1) ON CONFLICT (part_key) DO
|
||||||
UPDATE SET other_col = (SELECT count(*) from upsert_test);
|
UPDATE SET other_col = (SELECT count(*) from upsert_test);
|
||||||
|
|
|
@ -38,7 +38,7 @@ SELECT * FROM lineitem_pricing_summary ORDER BY l_returnflag, l_linestatus;
|
||||||
(4 rows)
|
(4 rows)
|
||||||
|
|
||||||
-- Test we can handle joins
|
-- Test we can handle joins
|
||||||
SET citusdb.large_table_shard_count TO 2;
|
SET citus.large_table_shard_count TO 2;
|
||||||
CREATE TABLE shipping_priority AS
|
CREATE TABLE shipping_priority AS
|
||||||
(
|
(
|
||||||
SELECT
|
SELECT
|
||||||
|
|
|
@ -4,15 +4,15 @@
|
||||||
-- Tests to check if we inform the user about potential caveats of creating new
|
-- Tests to check if we inform the user about potential caveats of creating new
|
||||||
-- databases, schemas, and roles.
|
-- databases, schemas, and roles.
|
||||||
CREATE DATABASE new_database;
|
CREATE DATABASE new_database;
|
||||||
NOTICE: CitusDB partially supports CREATE DATABASE for distributed databases
|
NOTICE: Citus partially supports CREATE DATABASE for distributed databases
|
||||||
DETAIL: CitusDB does not propagate CREATE DATABASE command to workers
|
DETAIL: Citus does not propagate CREATE DATABASE command to workers
|
||||||
HINT: You can manually create a database and its extensions on workers.
|
HINT: You can manually create a database and its extensions on workers.
|
||||||
CREATE SCHEMA new_schema;
|
CREATE SCHEMA new_schema;
|
||||||
NOTICE: CitusDB partially supports CREATE SCHEMA for distributed databases
|
NOTICE: Citus partially supports CREATE SCHEMA for distributed databases
|
||||||
DETAIL: schema usage in joins and in some UDFs provided by CitusDB are not supported yet
|
DETAIL: schema usage in joins and in some UDFs provided by Citus are not supported yet
|
||||||
CREATE ROLE new_role;
|
CREATE ROLE new_role;
|
||||||
NOTICE: CitusDB does not support CREATE ROLE/USER for distributed databases
|
NOTICE: Citus does not support CREATE ROLE/USER for distributed databases
|
||||||
DETAIL: Multiple roles are currently supported only for local tables
|
DETAIL: Multiple roles are currently supported only for local tables
|
||||||
CREATE USER new_user;
|
CREATE USER new_user;
|
||||||
NOTICE: CitusDB does not support CREATE ROLE/USER for distributed databases
|
NOTICE: Citus does not support CREATE ROLE/USER for distributed databases
|
||||||
DETAIL: Multiple roles are currently supported only for local tables
|
DETAIL: Multiple roles are currently supported only for local tables
|
||||||
|
|
|
@ -35,14 +35,14 @@ SELECT avg(distinct l_orderkey) FROM lineitem_range;
|
||||||
-- sharded table. For this test, we also change a config setting to ensure that
|
-- sharded table. For this test, we also change a config setting to ensure that
|
||||||
-- we don't repartition any of the tables during the query.
|
-- we don't repartition any of the tables during the query.
|
||||||
|
|
||||||
SET citusdb.large_table_shard_count TO 2;
|
SET citus.large_table_shard_count TO 2;
|
||||||
|
|
||||||
SELECT p_partkey, count(distinct l_orderkey) FROM lineitem_range, part
|
SELECT p_partkey, count(distinct l_orderkey) FROM lineitem_range, part
|
||||||
WHERE l_partkey = p_partkey
|
WHERE l_partkey = p_partkey
|
||||||
GROUP BY p_partkey
|
GROUP BY p_partkey
|
||||||
ORDER BY p_partkey LIMIT 10;
|
ORDER BY p_partkey LIMIT 10;
|
||||||
|
|
||||||
RESET citusdb.large_table_shard_count;
|
RESET citus.large_table_shard_count;
|
||||||
|
|
||||||
-- Check that we don't support count(distinct) on non-partition column, and
|
-- Check that we don't support count(distinct) on non-partition column, and
|
||||||
-- complex expressions.
|
-- complex expressions.
|
||||||
|
|
|
@ -17,16 +17,16 @@ CREATE TABLE multi_append_table_to_shard_left
|
||||||
SELECT master_create_distributed_table('multi_append_table_to_shard_left', 'left_number', 'append');
|
SELECT master_create_distributed_table('multi_append_table_to_shard_left', 'left_number', 'append');
|
||||||
|
|
||||||
-- Replicate 'left' table on both workers
|
-- Replicate 'left' table on both workers
|
||||||
SELECT set_config('citusdb.shard_replication_factor', '2', false);
|
SELECT set_config('citus.shard_replication_factor', '2', false);
|
||||||
\STAGE multi_append_table_to_shard_left FROM '@abs_srcdir@/data/agg.data'
|
\STAGE multi_append_table_to_shard_left FROM '@abs_srcdir@/data/agg.data'
|
||||||
\STAGE multi_append_table_to_shard_left FROM '@abs_srcdir@/data/agg.data'
|
\STAGE multi_append_table_to_shard_left FROM '@abs_srcdir@/data/agg.data'
|
||||||
|
|
||||||
-- Place 'right' table only on the primary worker
|
-- Place 'right' table only on the primary worker
|
||||||
SELECT set_config('citusdb.shard_replication_factor', '1', false);
|
SELECT set_config('citus.shard_replication_factor', '1', false);
|
||||||
\STAGE multi_append_table_to_shard_right FROM '@abs_srcdir@/data/agg.data'
|
\STAGE multi_append_table_to_shard_right FROM '@abs_srcdir@/data/agg.data'
|
||||||
|
|
||||||
-- Reset shard replication factor to ensure tasks will be assigned to both workers
|
-- Reset shard replication factor to ensure tasks will be assigned to both workers
|
||||||
SELECT set_config('citusdb.shard_replication_factor', '2', false);
|
SELECT set_config('citus.shard_replication_factor', '2', false);
|
||||||
|
|
||||||
-- All 8 rows in left table match a row in right table
|
-- All 8 rows in left table match a row in right table
|
||||||
SELECT COUNT(*)
|
SELECT COUNT(*)
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
\STAGE orders FROM '@abs_srcdir@/data/orders.1.data'
|
\STAGE orders FROM '@abs_srcdir@/data/orders.1.data'
|
||||||
\STAGE orders FROM '@abs_srcdir@/data/orders.2.data'
|
\STAGE orders FROM '@abs_srcdir@/data/orders.2.data'
|
||||||
|
|
||||||
SELECT set_config('citusdb.shard_replication_factor', '1', false);
|
SELECT set_config('citus.shard_replication_factor', '1', false);
|
||||||
|
|
||||||
\STAGE customer FROM '@abs_srcdir@/data/customer.1.data'
|
\STAGE customer FROM '@abs_srcdir@/data/customer.1.data'
|
||||||
\STAGE nation FROM '@abs_srcdir@/data/nation.data'
|
\STAGE nation FROM '@abs_srcdir@/data/nation.data'
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue