Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
postgres-lambda-diff
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jakob Huber
postgres-lambda-diff
Commits
8d303375
Commit
8d303375
authored
17 years ago
by
Tom Lane
Browse files
Options
Downloads
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
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/backend/utils/adt/pg_lzcompress.c
+15
-17
15 additions, 17 deletions
src/backend/utils/adt/pg_lzcompress.c
src/include/utils/pg_lzcompress.h
+11
-9
11 additions, 9 deletions
src/include/utils/pg_lzcompress.h
with
26 additions
and
26 deletions
src/backend/utils/adt/pg_lzcompress.c
+
15
−
17
View file @
8d303375
...
@@ -166,7 +166,7 @@
...
@@ -166,7 +166,7 @@
*
*
* Copyright (c) 1999-2007, PostgreSQL Global Development Group
* Copyright (c) 1999-2007, PostgreSQL Global Development Group
*
*
* $PostgreSQL: pgsql/src/backend/utils/adt/pg_lzcompress.c,v 1.2
6
2007/0
4/06
04
:
21:
43
tgl Exp $
* $PostgreSQL: pgsql/src/backend/utils/adt/pg_lzcompress.c,v 1.2
7
2007/0
8/
04
21:
53:00
tgl Exp $
* ----------
* ----------
*/
*/
#include
"postgres.h"
#include
"postgres.h"
...
@@ -211,29 +211,27 @@ typedef struct PGLZ_HistEntry
...
@@ -211,29 +211,27 @@ typedef struct PGLZ_HistEntry
* ----------
* ----------
*/
*/
static
const
PGLZ_Strategy
strategy_default_data
=
{
static
const
PGLZ_Strategy
strategy_default_data
=
{
256
,
/* Data chunks smaller 256 bytes are not
256
,
/* Data chunks less than 256 bytes are not
* compressed */
* compressed */
6144
,
/* Data chunks greater equal 6K force
6144
,
/* Data chunks >= 6K force compression, unless
* compression */
* compressed output is larger than input */
/* except compressed result is greater uncompressed data */
20
,
/* Below 6K, compression rates below 20% mean
20
,
/* Compression rates below 20% mean fallback
* fallback to uncompressed */
* to uncompressed */
/* storage except compression is forced by previous parameter */
128
,
/* Stop history lookup if a match of 128 bytes
128
,
/* Stop history lookup if a match of 128 bytes
* is found
*/
* is found
*/
10
/* Lower good match size by 10% at every
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
;
const
PGLZ_Strategy
*
const
PGLZ_strategy_default
=
&
strategy_default_data
;
static
const
PGLZ_Strategy
strategy_always_data
=
{
static
const
PGLZ_Strategy
strategy_always_data
=
{
0
,
/* Chunks of any size are compressed
*/
0
,
/* Chunks of any size are compressed
*/
0
,
/* */
0
,
0
,
/*
We want to save at least
one single byte
*/
0
,
/*
It's enough to save
one single byte
*/
128
,
/* Stop history lookup if a match of 128 bytes
128
,
/* Stop history lookup if a match of 128 bytes
* is found
*/
* is found
*/
6
/* Look harder for a good match
.
*/
6
/* Look harder for a good match
*/
};
};
const
PGLZ_Strategy
*
const
PGLZ_strategy_always
=
&
strategy_always_data
;
const
PGLZ_Strategy
*
const
PGLZ_strategy_always
=
&
strategy_always_data
;
...
@@ -511,7 +509,7 @@ pglz_compress(const char *source, int32 slen, PGLZ_Header *dest,
...
@@ -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
* If the strategy forbids compression (at all or if source chunk too
* small), fail.
* small), fail.
*/
*/
if
(
strategy
->
match_size_good
=
=
0
||
if
(
strategy
->
match_size_good
<
=
0
||
slen
<
strategy
->
min_input_size
)
slen
<
strategy
->
min_input_size
)
return
false
;
return
false
;
...
...
This diff is collapsed.
Click to expand it.
src/include/utils/pg_lzcompress.h
+
11
−
9
View file @
8d303375
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
*
*
* Definitions for the builtin LZ compressor
* Definitions for the builtin LZ compressor
*
*
* $PostgreSQL: pgsql/src/include/utils/pg_lzcompress.h,v 1.1
4
2007/0
2/27 23:48:1
0 tgl Exp $
* $PostgreSQL: pgsql/src/include/utils/pg_lzcompress.h,v 1.1
5
2007/0
8/04 21:53:0
0 tgl Exp $
* ----------
* ----------
*/
*/
...
@@ -50,16 +50,18 @@ typedef struct PGLZ_Header
...
@@ -50,16 +50,18 @@ typedef struct PGLZ_Header
*
*
* min_input_size Minimum input data size to start compression.
* min_input_size Minimum input data size to start compression.
*
*
* force_input_size Input data size at which compressed storage is
* force_input_size Minimum input data size to force compression
* forced even if the compression rate drops below
* even if the compression rate drops below
* min_comp_rate (but not below 0).
* min_comp_rate. But in any case the output
*
* must be smaller than the input. If that isn't
* min_comp_rate Minimum compression rate (0-99%), the output
* must be smaller than the input. If that isn't
* the case, the compressor will throw away its
* the case, the compressor will throw away its
* output and copy the original, uncompressed data
* output and copy the original, uncompressed data
* to the output buffer.
* 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
* match_size_good The initial GOOD match size when starting history
* lookup. When looking up the history to find a
* lookup. When looking up the history to find a
* match that could be expressed as a tag, the
* match that could be expressed as a tag, the
...
@@ -70,8 +72,8 @@ typedef struct PGLZ_Header
...
@@ -70,8 +72,8 @@ typedef struct PGLZ_Header
* longer the lookup takes, the smaller matches
* longer the lookup takes, the smaller matches
* are considered good.
* are considered good.
*
*
* match_size_drop The percentage
,
match_size_good is lowered
* match_size_drop The percentage
by which
match_size_good is lowered
* a
t
each history check. Allowed values are
* a
fter
each history check. Allowed values are
* 0 (no change until end) to 100 (only check
* 0 (no change until end) to 100 (only check
* latest history entry at all).
* latest history entry at all).
* ----------
* ----------
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment