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
8d303375
Commit
8d303375
authored
Aug 04, 2007
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix up bad layout of some comments (probably pg_indent's fault), and
improve grammar a tad. Per Greg Stark.
parent
087a2713
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
26 deletions
+26
-26
src/backend/utils/adt/pg_lzcompress.c
src/backend/utils/adt/pg_lzcompress.c
+15
-17
src/include/utils/pg_lzcompress.h
src/include/utils/pg_lzcompress.h
+11
-9
No files found.
src/backend/utils/adt/pg_lzcompress.c
View file @
8d303375
...
...
@@ -166,7 +166,7 @@
*
* Copyright (c) 1999-2007, PostgreSQL Global Development Group
*
* $PostgreSQL: pgsql/src/backend/utils/adt/pg_lzcompress.c,v 1.2
6 2007/04/06 04:21:43
tgl Exp $
* $PostgreSQL: pgsql/src/backend/utils/adt/pg_lzcompress.c,v 1.2
7 2007/08/04 21:53:00
tgl Exp $
* ----------
*/
#include "postgres.h"
...
...
@@ -211,29 +211,27 @@ typedef struct PGLZ_HistEntry
* ----------
*/
static
const
PGLZ_Strategy
strategy_default_data
=
{
256
,
/* Data chunks smaller 256 bytes are not
* compressed */
6144
,
/* Data chunks greater equal 6K force
* compression */
/* except compressed result is greater uncompressed data */
20
,
/* Compression rates below 20% mean fallback
* to uncompressed */
/* storage except compression is forced by previous parameter */
256
,
/* Data chunks less than 256 bytes are not
* compressed */
6144
,
/* Data chunks >= 6K force compression, unless
* compressed output is larger than input */
20
,
/* Below 6K, compression rates below 20% mean
* fallback to uncompressed */
128
,
/* Stop history lookup if a match of 128 bytes
* is found
*/
* is found
*/
10
/* Lower good match size by 10% at every
* lookup loop iteration
.
*/
* lookup loop iteration */
};
const
PGLZ_Strategy
*
const
PGLZ_strategy_default
=
&
strategy_default_data
;
static
const
PGLZ_Strategy
strategy_always_data
=
{
0
,
/* Chunks of any size are compressed
*/
0
,
/* */
0
,
/*
We want to save at least one single byte
*/
0
,
/* Chunks of any size are compressed
*/
0
,
0
,
/*
It's enough to save one single byte
*/
128
,
/* Stop history lookup if a match of 128 bytes
* is found
*/
6
/* Look harder for a good match
.
*/
* is found
*/
6
/* Look harder for a good match
*/
};
const
PGLZ_Strategy
*
const
PGLZ_strategy_always
=
&
strategy_always_data
;
...
...
@@ -511,7 +509,7 @@ pglz_compress(const char *source, int32 slen, PGLZ_Header *dest,
* If the strategy forbids compression (at all or if source chunk too
* small), fail.
*/
if
(
strategy
->
match_size_good
=
=
0
||
if
(
strategy
->
match_size_good
<
=
0
||
slen
<
strategy
->
min_input_size
)
return
false
;
...
...
src/include/utils/pg_lzcompress.h
View file @
8d303375
...
...
@@ -3,7 +3,7 @@
*
* Definitions for the builtin LZ compressor
*
* $PostgreSQL: pgsql/src/include/utils/pg_lzcompress.h,v 1.1
4 2007/02/27 23:48:1
0 tgl Exp $
* $PostgreSQL: pgsql/src/include/utils/pg_lzcompress.h,v 1.1
5 2007/08/04 21:53:0
0 tgl Exp $
* ----------
*/
...
...
@@ -50,16 +50,18 @@ typedef struct PGLZ_Header
*
* min_input_size Minimum input data size to start compression.
*
* force_input_size Input data size at which compressed storage is
* forced even if the compression rate drops below
* min_comp_rate (but not below 0).
*
* min_comp_rate Minimum compression rate (0-99%), the output
* must be smaller than the input. If that isn't
* force_input_size Minimum input data size to force compression
* even if the compression rate drops below
* min_comp_rate. But in any case the output
* must be smaller than the input. If that isn't
* the case, the compressor will throw away its
* output and copy the original, uncompressed data
* to the output buffer.
*
* min_comp_rate Minimum compression rate (0-99%) to require for
* inputs smaller than force_input_size. If not
* achieved, the output will be uncompressed.
*
* match_size_good The initial GOOD match size when starting history
* lookup. When looking up the history to find a
* match that could be expressed as a tag, the
...
...
@@ -70,8 +72,8 @@ typedef struct PGLZ_Header
* longer the lookup takes, the smaller matches
* are considered good.
*
* match_size_drop The percentage
,
match_size_good is lowered
* a
t
each history check. Allowed values are
* match_size_drop The percentage
by which
match_size_good is lowered
* a
fter
each history check. Allowed values are
* 0 (no change until end) to 100 (only check
* latest history entry at all).
* ----------
...
...
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