Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
28d8b42c
Commit
28d8b42c
authored
Jan 27, 1999
by
Jan Wieck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Speedup of PL/pgSQL by calling ExecEvalExpr() directly
instead of SPI_execp() for simple expressions. Jan
parent
d611ccb8
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
439 additions
and
117 deletions
+439
-117
src/backend/executor/spi.c
src/backend/executor/spi.c
+14
-23
src/include/executor/spi.h
src/include/executor/spi.h
+2
-0
src/include/executor/spi_priv.h
src/include/executor/spi_priv.h
+38
-0
src/pl/plpgsql/src/pl_exec.c
src/pl/plpgsql/src/pl_exec.c
+382
-93
src/pl/plpgsql/src/plpgsql.h
src/pl/plpgsql/src/plpgsql.h
+3
-1
No files found.
src/backend/executor/spi.c
View file @
28d8b42c
...
...
@@ -3,25 +3,16 @@
* spi.c--
* Server Programming Interface
*
* $Id: spi.c,v 1.3
1 1999/01/27 00:36:21 tgl
Exp $
* $Id: spi.c,v 1.3
2 1999/01/27 16:15:20 wieck
Exp $
*
*-------------------------------------------------------------------------
*/
#include "executor/spi.h"
#include "executor/spi_priv.h"
#include "catalog/pg_type.h"
#include "access/printtup.h"
#include "fmgr.h"
typedef
struct
{
QueryTreeList
*
qtlist
;
/* malloced */
uint32
processed
;
/* by Executor */
SPITupleTable
*
tuptable
;
Portal
portal
;
/* portal per procedure */
MemoryContext
savedcxt
;
CommandId
savedId
;
}
_SPI_connection
;
static
Portal
_SPI_portal
=
(
Portal
)
NULL
;
static
_SPI_connection
*
_SPI_stack
=
NULL
;
static
_SPI_connection
*
_SPI_current
=
NULL
;
...
...
@@ -32,24 +23,12 @@ uint32 SPI_processed = 0;
SPITupleTable
*
SPI_tuptable
;
int
SPI_result
;
typedef
struct
{
QueryTreeList
*
qtlist
;
List
*
ptlist
;
int
nargs
;
Oid
*
argtypes
;
}
_SPI_plan
;
static
int
_SPI_execute
(
char
*
src
,
int
tcount
,
_SPI_plan
*
plan
);
static
int
_SPI_pquery
(
QueryDesc
*
queryDesc
,
EState
*
state
,
int
tcount
);
static
int
_SPI_execute_plan
(
_SPI_plan
*
plan
,
Datum
*
Values
,
char
*
Nulls
,
int
tcount
);
#define _SPI_CPLAN_CURCXT 0
#define _SPI_CPLAN_PROCXT 1
#define _SPI_CPLAN_TOPCXT 2
static
_SPI_plan
*
_SPI_copy_plan
(
_SPI_plan
*
plan
,
int
location
);
static
int
_SPI_begin_call
(
bool
execmem
);
...
...
@@ -178,6 +157,18 @@ SPI_finish()
}
void
SPI_push
(
void
)
{
_SPI_curid
++
;
}
void
SPI_pop
(
void
)
{
_SPI_curid
--
;
}
int
SPI_exec
(
char
*
src
,
int
tcount
)
{
...
...
src/include/executor/spi.h
View file @
28d8b42c
...
...
@@ -72,6 +72,8 @@ extern int SPI_result;
extern
int
SPI_connect
(
void
);
extern
int
SPI_finish
(
void
);
extern
void
SPI_push
(
void
);
extern
void
SPI_pop
(
void
);
extern
int
SPI_exec
(
char
*
src
,
int
tcount
);
extern
int
SPI_execp
(
void
*
plan
,
Datum
*
values
,
char
*
Nulls
,
int
tcount
);
extern
void
*
SPI_prepare
(
char
*
src
,
int
nargs
,
Oid
*
argtypes
);
...
...
src/include/executor/spi_priv.h
0 → 100644
View file @
28d8b42c
/*-------------------------------------------------------------------------
*
* spi.c--
* Server Programming Interface private declarations
*
* $Header: /cvsroot/pgsql/src/include/executor/spi_priv.h,v 1.1 1999/01/27 16:15:21 wieck Exp $
*
*-------------------------------------------------------------------------
*/
#ifndef SPI_PRIV_H
#define SPI_PRIV_H
#include "catalog/pg_type.h"
#include "access/printtup.h"
typedef
struct
{
QueryTreeList
*
qtlist
;
/* malloced */
uint32
processed
;
/* by Executor */
SPITupleTable
*
tuptable
;
Portal
portal
;
/* portal per procedure */
MemoryContext
savedcxt
;
CommandId
savedId
;
}
_SPI_connection
;
typedef
struct
{
QueryTreeList
*
qtlist
;
List
*
ptlist
;
int
nargs
;
Oid
*
argtypes
;
}
_SPI_plan
;
#define _SPI_CPLAN_CURCXT 0
#define _SPI_CPLAN_PROCXT 1
#define _SPI_CPLAN_TOPCXT 2
#endif
/* SPI_PRIV_H */
src/pl/plpgsql/src/pl_exec.c
View file @
28d8b42c
This diff is collapsed.
Click to expand it.
src/pl/plpgsql/src/plpgsql.h
View file @
28d8b42c
...
...
@@ -3,7 +3,7 @@
* procedural language
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/pl/plpgsql/src/plpgsql.h,v 1.
2 1998/09/01 04:40:27 momjian
Exp $
* $Header: /cvsroot/pgsql/src/pl/plpgsql/src/plpgsql.h,v 1.
3 1999/01/27 16:15:22 wieck
Exp $
*
* This software is copyrighted by Jan Wieck - Hamburg.
*
...
...
@@ -143,6 +143,8 @@ typedef struct
int
exprno
;
char
*
query
;
void
*
plan
;
Node
*
plan_simple_expr
;
Oid
plan_simple_type
;
Oid
*
plan_argtypes
;
int
nparams
;
int
params
[
1
];
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment