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
7d301947
Commit
7d301947
authored
Jun 07, 2000
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Re-order pg_listener index so it can later be used in an index scan.
parent
75b950f6
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
27 additions
and
42 deletions
+27
-42
src/backend/catalog/indexing.c
src/backend/catalog/indexing.c
+8
-8
src/backend/commands/async.c
src/backend/commands/async.c
+9
-24
src/backend/utils/cache/syscache.c
src/backend/utils/cache/syscache.c
+4
-4
src/include/catalog/catversion.h
src/include/catalog/catversion.h
+2
-2
src/include/catalog/indexing.h
src/include/catalog/indexing.h
+4
-4
No files found.
src/backend/catalog/indexing.c
View file @
7d301947
...
...
@@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/indexing.c,v 1.6
3 2000/06/07 02:44:35
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/catalog/indexing.c,v 1.6
4 2000/06/07 04:09:33
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -51,7 +51,7 @@ char *Name_pg_inherits_indices[Num_pg_inherits_indices] =
char
*
Name_pg_language_indices
[
Num_pg_language_indices
]
=
{
LanguageOidIndex
,
LanguageNameIndex
};
char
*
Name_pg_listener_indices
[
Num_pg_listener_indices
]
=
{
Listener
RelnamePid
Index
};
{
Listener
PidRelname
Index
};
char
*
Name_pg_opclass_indices
[
Num_pg_opclass_indices
]
=
{
OpclassNameIndex
,
OpclassDeftypeIndex
};
char
*
Name_pg_operator_indices
[
Num_pg_operator_indices
]
=
...
...
@@ -653,7 +653,7 @@ LanguageOidIndexScan(Relation heapRelation, Oid lanId)
HeapTuple
Listener
RelnamePidIndexScan
(
Relation
heapRelation
,
char
*
relName
,
int4
pid
)
Listener
PidRelnameIndexScan
(
Relation
heapRelation
,
int4
pid
,
char
*
relName
)
{
Relation
idesc
;
ScanKeyData
skey
[
2
];
...
...
@@ -662,16 +662,16 @@ ListenerRelnamePidIndexScan(Relation heapRelation, char *relName, int4 pid)
ScanKeyEntryInitialize
(
&
skey
[
0
],
(
bits16
)
0x0
,
(
AttrNumber
)
1
,
(
RegProcedure
)
F_
NAME
EQ
,
PointerGetDatum
(
relName
));
(
RegProcedure
)
F_
INT4
EQ
,
Int32GetDatum
(
pid
));
ScanKeyEntryInitialize
(
&
skey
[
1
],
(
bits16
)
0x0
,
(
AttrNumber
)
2
,
(
RegProcedure
)
F_
INT4
EQ
,
Int32GetDatum
(
pid
));
(
RegProcedure
)
F_
NAME
EQ
,
PointerGetDatum
(
relName
));
idesc
=
index_openr
(
Listener
RelnamePid
Index
);
idesc
=
index_openr
(
Listener
PidRelname
Index
);
tuple
=
CatalogIndexFetchTuple
(
heapRelation
,
idesc
,
skey
,
2
);
index_close
(
idesc
);
...
...
src/backend/commands/async.c
View file @
7d301947
...
...
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/async.c,v 1.6
3 2000/06/04 01:44:29 petere
Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/async.c,v 1.6
4 2000/06/07 04:09:34 momjian
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -159,7 +159,6 @@ Async_Notify(char *relname)
/* no point in making duplicate entries in the list ... */
if
(
!
AsyncExistsPendingNotify
(
relname
))
{
/*
* We allocate list memory from the global malloc pool to ensure
* that it will live until we want to use it. This is probably
...
...
@@ -202,7 +201,6 @@ Async_Listen(char *relname, int pid)
Datum
d
;
int
i
;
bool
isnull
;
int
alreadyListener
=
0
;
TupleDesc
tupDesc
;
if
(
Trace_notify
)
...
...
@@ -212,25 +210,12 @@ Async_Listen(char *relname, int pid)
tdesc
=
RelationGetDescr
(
lRel
);
/* Detect whether we are already listening on this relname */
scan
=
heap_beginscan
(
lRel
,
0
,
SnapshotNow
,
0
,
(
ScanKey
)
NULL
);
while
(
HeapTupleIsValid
(
tuple
=
heap_getnext
(
scan
,
0
)))
{
d
=
heap_getattr
(
tuple
,
Anum_pg_listener_relname
,
tdesc
,
&
isnull
);
if
(
!
strncmp
((
char
*
)
DatumGetPointer
(
d
),
relname
,
NAMEDATALEN
))
{
d
=
heap_getattr
(
tuple
,
Anum_pg_listener_pid
,
tdesc
,
&
isnull
);
if
(
DatumGetInt32
(
d
)
==
pid
)
tuple
=
SearchSysCacheTuple
(
LISTENREL
,
Int32GetDatum
(
pid
),
PointerGetDatum
(
relname
),
0
,
0
);
if
(
tuple
!=
NULL
)
{
alreadyListener
=
1
;
/* No need to scan the rest of the table */
break
;
}
}
}
heap_endscan
(
scan
);
if
(
alreadyListener
)
{
heap_close
(
lRel
,
AccessExclusiveLock
);
elog
(
NOTICE
,
"Async_Listen: We are already listening on %s"
,
relname
);
return
;
...
...
@@ -313,8 +298,8 @@ Async_Unlisten(char *relname, int pid)
lRel
=
heap_openr
(
ListenerRelationName
,
AccessExclusiveLock
);
/* Note we assume there can be only one matching tuple. */
lTuple
=
SearchSysCacheTuple
(
LISTENREL
,
PointerGetDatum
(
relname
),
Int32GetDatum
(
pid
),
lTuple
=
SearchSysCacheTuple
(
LISTENREL
,
Int32GetDatum
(
pid
),
PointerGetDatum
(
relname
),
0
,
0
);
if
(
lTuple
!=
NULL
)
heap_delete
(
lRel
,
&
lTuple
->
t_self
,
NULL
);
...
...
src/backend/utils/cache/syscache.c
View file @
7d301947
...
...
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/cache/syscache.c,v 1.5
2 2000/06/07 02:44:37
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/cache/syscache.c,v 1.5
3 2000/06/07 04:09:36
momjian Exp $
*
* NOTES
* These routines allow the parser/planner/executor to perform
...
...
@@ -241,14 +241,14 @@ static struct cachedesc cacheinfo[] = {
{
ListenerRelationName
,
/* LISTENREL */
2
,
{
Anum_pg_listener_relname
,
Anum_pg_listener_pid
,
Anum_pg_listener_relname
,
0
,
0
},
sizeof
(
FormData_pg_listener
),
Listener
RelnamePid
Index
,
Listener
RelnamePid
IndexScan
},
Listener
PidRelname
Index
,
Listener
PidRelname
IndexScan
},
{
OperatorRelationName
,
/* OPERNAME */
4
,
{
...
...
src/include/catalog/catversion.h
View file @
7d301947
...
...
@@ -37,7 +37,7 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Id: catversion.h,v 1.2
5 2000/06/07 03:02:08
momjian Exp $
* $Id: catversion.h,v 1.2
6 2000/06/07 04:09:44
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -53,6 +53,6 @@
*/
/* yyyymmddN */
#define CATALOG_VERSION_NO 2000060
6
1
#define CATALOG_VERSION_NO 2000060
7
1
#endif
src/include/catalog/indexing.h
View file @
7d301947
...
...
@@ -8,7 +8,7 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Id: indexing.h,v 1.3
8 2000/06/07 02:44:40
momjian Exp $
* $Id: indexing.h,v 1.3
9 2000/06/07 04:09:44
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -63,7 +63,7 @@
#define InheritsRelidSeqnoIndex "pg_inherits_relid_seqno_index"
#define LanguageNameIndex "pg_language_name_index"
#define LanguageOidIndex "pg_language_oid_index"
#define Listener
RelnamePidIndex "pg_listener_relname_pid
_index"
#define Listener
PidRelnameIndex "pg_listener_pid_relname
_index"
#define OpclassDeftypeIndex "pg_opclass_deftype_index"
#define OpclassNameIndex "pg_opclass_name_index"
#define OperatorNameIndex "pg_operator_oprname_l_r_k_index"
...
...
@@ -141,7 +141,7 @@ extern HeapTuple InheritsRelidSeqnoIndexScan(Relation heapRelation, Oid relid,
int4
seqno
);
extern
HeapTuple
LanguageNameIndexScan
(
Relation
heapRelation
,
char
*
lanName
);
extern
HeapTuple
LanguageOidIndexScan
(
Relation
heapRelation
,
Oid
lanId
);
extern
HeapTuple
Listener
RelnamePidIndexScan
(
Relation
heapRelation
,
char
*
relName
,
int4
pid
);
extern
HeapTuple
Listener
PidRelnameIndexScan
(
Relation
heapRelation
,
int4
pid
,
char
*
relName
);
extern
HeapTuple
OpclassDeftypeIndexScan
(
Relation
heapRelation
,
Oid
defType
);
extern
HeapTuple
OpclassNameIndexScan
(
Relation
heapRelation
,
char
*
opcName
);
extern
HeapTuple
OperatorNameIndexScan
(
Relation
heapRelation
,
...
...
@@ -190,7 +190,7 @@ DECLARE_UNIQUE_INDEX(pg_index_indexrelid_index on pg_index using btree(indexreli
DECLARE_UNIQUE_INDEX
(
pg_inherits_relid_seqno_index
on
pg_inherits
using
btree
(
inhrelid
oid_ops
,
inhseqno
int4_ops
));
DECLARE_UNIQUE_INDEX
(
pg_language_name_index
on
pg_language
using
btree
(
lanname
name_ops
));
DECLARE_UNIQUE_INDEX
(
pg_language_oid_index
on
pg_language
using
btree
(
oid
oid_ops
));
DECLARE_UNIQUE_INDEX
(
pg_listener_
relname_pid_index
on
pg_listener
using
btree
(
relname
name_ops
,
listenerpid
int4
_ops
));
DECLARE_UNIQUE_INDEX
(
pg_listener_
pid_relname_index
on
pg_listener
using
btree
(
listenerpid
int4_ops
,
relname
name
_ops
));
/* This column needs to allow multiple zero entries, but is in the cache */
DECLARE_INDEX
(
pg_opclass_deftype_index
on
pg_opclass
using
btree
(
opcdeftype
oid_ops
));
DECLARE_UNIQUE_INDEX
(
pg_opclass_name_index
on
pg_opclass
using
btree
(
opcname
name_ops
));
...
...
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