MobilityDB 1.1
Data Structures | Macros | Functions | Variables
meos_catalog.c File Reference
#include "pg_general/meos_catalog.h"
#include <postgres.h>
#include <miscadmin.h>
#include <access/heapam.h>
#include <access/htup_details.h>
#include <access/tableam.h>
#include <catalog/namespace.h>
#include <access/hash.h>
#include <lib/simplehash.h>
#include <utils/rel.h>
#include "general/temporaltypes.h"
#include "general/meos_catalog.h"
Include dependency graph for meos_catalog.c:

Data Structures

struct  _oid_oper_entry
 Structure to represent the operator cache hash table. More...
 

Macros

#define SH_DECLARE
 
#define SH_DEFINE
 
#define SH_ELEMENT_TYPE   _oid_oper_entry
 
#define SH_EQUAL(tb, a, b)   a == b
 
#define SH_HASH_KEY(tb, key)   hash_bytes_uint32(key)
 
#define SH_KEY   oproid
 
#define SH_KEY_TYPE   Oid
 
#define SH_PREFIX   opertable
 
#define SH_SCOPE   static inline
 

Functions

PGDLLEXPORT Datum fill_oid_cache (PG_FUNCTION_ARGS)
 Function executed during the CREATE EXTENSION to precompute the operator cache and store it in table mobilitydb_opcache More...
 
static bool internal_type (const char *typname)
 Determine whether the type is an internal MobilityDB type. More...
 
meosOper name_oper (const char *name)
 Fetch the operator number from its name. More...
 
int namestrcmp (Name name, const char *str)
 Create a cache of PostgreSQL type and operator Oids in global arrays to avoid (slow) lookups. More...
 
meosOper oid_oper (Oid oproid, meosType *ltype, meosType *rtype)
 Fetch from the hash table the operator info. More...
 
meosType oid_type (Oid typid)
 Fetch from the cache the type number. More...
 
const char * oper_name (meosOper oper)
 Return the string name from an operator number. More...
 
Oid oper_oid (meosOper oper, meosType lt, meosType rt)
 Fetch from the cache the Oid of an operator. More...
 
static void populate_operoid_cache ()
 Populate the operator Oid cache from the precomputed operator cache stored in table mobilitydb_opcache. More...
 
static void populate_typeoid_cache ()
 Populate the type Oid cache. More...
 
Oid type_oid (meosType type)
 Fetch from the cache the Oid of a type. More...
 

Variables

bool _oid_cache_ready = false
 Global variable that states whether the type and operator Oid caches have been initialized. More...
 
struct opertable_hash * _oid_oper = NULL
 Global hash table that keeps the operator Oids used in MobilityDB. More...
 
const char * _oper_names []
 Global array containing operator names used in MobilityDB. More...
 
Oid _oper_oid [sizeof(_oper_names)/sizeof(char *)][sizeof(_type_names)/sizeof(char *)][sizeof(_type_names)/sizeof(char *)]
 Global 3-dimensional array that keeps the operator Oids used in MobilityDB. More...
 
const char * _type_names []
 Global array containing type names used in MobilityDB. More...
 
Oid _type_oids [sizeof(_type_names)/sizeof(char *)]
 Global array that keeps the type Oids used in MobilityDB. More...