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
bd165757
Commit
bd165757
authored
Aug 25, 2011
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a regression test for pgstattuple.
This is mainly to prove that the NaN fix actually works cross-platform.
parent
af7d1812
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
61 additions
and
0 deletions
+61
-0
contrib/pgstattuple/.gitignore
contrib/pgstattuple/.gitignore
+4
-0
contrib/pgstattuple/Makefile
contrib/pgstattuple/Makefile
+2
-0
contrib/pgstattuple/expected/pgstattuple.out
contrib/pgstattuple/expected/pgstattuple.out
+38
-0
contrib/pgstattuple/sql/pgstattuple.sql
contrib/pgstattuple/sql/pgstattuple.sql
+17
-0
No files found.
contrib/pgstattuple/.gitignore
0 → 100644
View file @
bd165757
# Generated subdirectories
/log/
/results/
/tmp_check/
contrib/pgstattuple/Makefile
View file @
bd165757
...
...
@@ -6,6 +6,8 @@ OBJS = pgstattuple.o pgstatindex.o
EXTENSION
=
pgstattuple
DATA
=
pgstattuple--1.0.sql pgstattuple--unpackaged--1.0.sql
REGRESS
=
pgstattuple
ifdef
USE_PGXS
PG_CONFIG
=
pg_config
PGXS
:=
$(
shell
$(PG_CONFIG)
--pgxs
)
...
...
contrib/pgstattuple/expected/pgstattuple.out
0 → 100644
View file @
bd165757
CREATE EXTENSION pgstattuple;
--
-- It's difficult to come up with platform-independent test cases for
-- the pgstattuple functions, but the results for empty tables and
-- indexes should be that.
--
create table test (a int primary key);
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "test_pkey" for table "test"
select * from pgstattuple('test'::text);
table_len | tuple_count | tuple_len | tuple_percent | dead_tuple_count | dead_tuple_len | dead_tuple_percent | free_space | free_percent
-----------+-------------+-----------+---------------+------------------+----------------+--------------------+------------+--------------
0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0
(1 row)
select * from pgstattuple('test'::regclass);
table_len | tuple_count | tuple_len | tuple_percent | dead_tuple_count | dead_tuple_len | dead_tuple_percent | free_space | free_percent
-----------+-------------+-----------+---------------+------------------+----------------+--------------------+------------+--------------
0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0
(1 row)
select * from pgstatindex('test_pkey');
version | tree_level | index_size | root_block_no | internal_pages | leaf_pages | empty_pages | deleted_pages | avg_leaf_density | leaf_fragmentation
---------+------------+------------+---------------+----------------+------------+-------------+---------------+------------------+--------------------
2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | NaN | NaN
(1 row)
select pg_relpages('test');
pg_relpages
-------------
0
(1 row)
select pg_relpages('test_pkey');
pg_relpages
-------------
1
(1 row)
contrib/pgstattuple/sql/pgstattuple.sql
0 → 100644
View file @
bd165757
CREATE
EXTENSION
pgstattuple
;
--
-- It's difficult to come up with platform-independent test cases for
-- the pgstattuple functions, but the results for empty tables and
-- indexes should be that.
--
create
table
test
(
a
int
primary
key
);
select
*
from
pgstattuple
(
'test'
::
text
);
select
*
from
pgstattuple
(
'test'
::
regclass
);
select
*
from
pgstatindex
(
'test_pkey'
);
select
pg_relpages
(
'test'
);
select
pg_relpages
(
'test_pkey'
);
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