Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
e9751234
G
Gpdb
项目概览
Greenplum
/
Gpdb
通知
7
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
Gpdb
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
e9751234
编写于
4月 24, 2002
作者:
B
Bruce Momjian
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Speed improvement for large object restore.
Mario Weilguni
上级
5d2fdf6e
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
64 addition
and
14 deletion
+64
-14
src/bin/pg_dump/pg_backup_archiver.c
src/bin/pg_dump/pg_backup_archiver.c
+37
-8
src/bin/pg_dump/pg_backup_archiver.h
src/bin/pg_dump/pg_backup_archiver.h
+5
-1
src/bin/pg_dump/pg_backup_custom.c
src/bin/pg_dump/pg_backup_custom.c
+7
-1
src/bin/pg_dump/pg_backup_files.c
src/bin/pg_dump/pg_backup_files.c
+7
-1
src/bin/pg_dump/pg_backup_null.c
src/bin/pg_dump/pg_backup_null.c
+1
-2
src/bin/pg_dump/pg_backup_tar.c
src/bin/pg_dump/pg_backup_tar.c
+7
-1
未找到文件。
src/bin/pg_dump/pg_backup_archiver.c
浏览文件 @
e9751234
...
...
@@ -15,7 +15,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_archiver.c,v 1.4
2 2002/02/11 00:18:20 tgl
Exp $
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_archiver.c,v 1.4
3 2002/04/24 02:21:04 momjian
Exp $
*
* Modifications - 28-Jun-2000 - pjw@rhyme.com.au
*
...
...
@@ -819,6 +819,9 @@ StartRestoreBlob(ArchiveHandle *AH, Oid oid)
AH
->
createdBlobXref
=
1
;
}
/* Initialize the LO Buffer */
AH
->
lo_buf_used
=
0
;
/*
* Start long-running TXs if necessary
*/
...
...
@@ -848,6 +851,19 @@ StartRestoreBlob(ArchiveHandle *AH, Oid oid)
void
EndRestoreBlob
(
ArchiveHandle
*
AH
,
Oid
oid
)
{
if
(
AH
->
lo_buf_used
>
0
)
{
/* Write remaining bytes from the LO buffer */
int
res
;
res
=
lo_write
(
AH
->
connection
,
AH
->
loFd
,
(
void
*
)
AH
->
lo_buf
,
AH
->
lo_buf_used
);
ahlog
(
AH
,
5
,
"wrote remaining %d bytes of large object data (result = %d)
\n
"
,
(
int
)
AH
->
lo_buf_used
,
res
);
if
(
res
!=
AH
->
lo_buf_used
)
die_horribly
(
AH
,
modulename
,
"could not write to large object (result: %d, expected: %d)
\n
"
,
res
,
AH
->
lo_buf_used
);
AH
->
lo_buf_used
=
0
;
}
lo_close
(
AH
->
connection
,
AH
->
loFd
);
AH
->
writingBlob
=
0
;
...
...
@@ -1228,14 +1244,27 @@ ahwrite(const void *ptr, size_t size, size_t nmemb, ArchiveHandle *AH)
if
(
AH
->
writingBlob
)
{
res
=
lo_write
(
AH
->
connection
,
AH
->
loFd
,
(
void
*
)
ptr
,
size
*
nmemb
);
ahlog
(
AH
,
5
,
"wrote %d bytes of large object data (result = %d)
\n
"
,
(
int
)
(
size
*
nmemb
),
res
);
if
(
res
!=
size
*
nmemb
)
die_horribly
(
AH
,
modulename
,
"could not write to large object (result: %d, expected: %d)
\n
"
,
res
,
(
int
)
(
size
*
nmemb
));
if
(
AH
->
lo_buf_used
+
size
*
nmemb
>
AH
->
lo_buf_size
)
{
/* Split LO buffer */
int
remaining
=
AH
->
lo_buf_size
-
AH
->
lo_buf_used
;
int
slack
=
nmemb
*
size
-
remaining
;
return
res
;
memcpy
(
AH
->
lo_buf
+
AH
->
lo_buf_used
,
ptr
,
remaining
);
res
=
lo_write
(
AH
->
connection
,
AH
->
loFd
,
AH
->
lo_buf
,
AH
->
lo_buf_size
);
ahlog
(
AH
,
5
,
"wrote %d bytes of large object data (result = %d)
\n
"
,
AH
->
lo_buf_size
,
res
);
if
(
res
!=
AH
->
lo_buf_size
)
die_horribly
(
AH
,
modulename
,
"could not write to large object (result: %d, expected: %d)
\n
"
,
res
,
AH
->
lo_buf_size
);
memcpy
(
AH
->
lo_buf
,
ptr
+
remaining
,
slack
);
AH
->
lo_buf_used
=
slack
;
}
else
{
/* LO Buffer is still large enough, buffer it */
memcpy
(
AH
->
lo_buf
+
AH
->
lo_buf_used
,
ptr
,
size
*
nmemb
);
AH
->
lo_buf_used
+=
size
*
nmemb
;
}
return
size
*
nmemb
;
}
else
if
(
AH
->
gzOut
)
{
...
...
src/bin/pg_dump/pg_backup_archiver.h
浏览文件 @
e9751234
...
...
@@ -17,7 +17,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_archiver.h,v 1.4
1 2001/11/05 17:46:30
momjian Exp $
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_archiver.h,v 1.4
2 2002/04/24 02:21:04
momjian Exp $
*
* Modifications - 28-Jun-2000 - pjw@rhyme.com.au
* - Initial version.
...
...
@@ -41,6 +41,7 @@
#include <errno.h>
#include "pqexpbuffer.h"
#define LOBBUFSIZE 32768
#ifdef HAVE_LIBZ
#include <zlib.h>
...
...
@@ -240,6 +241,9 @@ typedef struct _archiveHandle
RestoreOptions
*
ropt
;
/* Used to check restore options in
* ahwrite etc */
void
*
lo_buf
;
int
lo_buf_used
;
int
lo_buf_size
;
}
ArchiveHandle
;
typedef
struct
_tocEntry
...
...
src/bin/pg_dump/pg_backup_custom.c
浏览文件 @
e9751234
...
...
@@ -19,7 +19,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_custom.c,v 1.1
7 2001/11/27 23:48:12 tgl
Exp $
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_custom.c,v 1.1
8 2002/04/24 02:21:04 momjian
Exp $
*
* Modifications - 28-Jun-2000 - pjw@rhyme.com.au
*
...
...
@@ -153,6 +153,12 @@ InitArchiveFmt_Custom(ArchiveHandle *AH)
if
(
ctx
->
zp
==
NULL
)
die_horribly
(
AH
,
modulename
,
"out of memory
\n
"
);
/* Initialize LO buffering */
AH
->
lo_buf_size
=
LOBBUFSIZE
;
AH
->
lo_buf
=
(
void
*
)
malloc
(
LOBBUFSIZE
);
if
(
AH
->
lo_buf
==
NULL
)
die_horribly
(
AH
,
modulename
,
"out of memory
\n
"
);
/*
* zlibOutSize is the buffer size we tell zlib it can output to. We
* actually allocate one extra byte because some routines want to
...
...
src/bin/pg_dump/pg_backup_files.c
浏览文件 @
e9751234
...
...
@@ -20,7 +20,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_files.c,v 1.1
4 2001/10/25 05:49:52
momjian Exp $
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_files.c,v 1.1
5 2002/04/24 02:21:04
momjian Exp $
*
* Modifications - 28-Jun-2000 - pjw@rhyme.com.au
*
...
...
@@ -113,6 +113,12 @@ InitArchiveFmt_Files(ArchiveHandle *AH)
AH
->
formatData
=
(
void
*
)
ctx
;
ctx
->
filePos
=
0
;
/* Initialize LO buffering */
AH
->
lo_buf_size
=
LOBBUFSIZE
;
AH
->
lo_buf
=
(
void
*
)
malloc
(
LOBBUFSIZE
);
if
(
AH
->
lo_buf
==
NULL
)
die_horribly
(
AH
,
modulename
,
"out of memory
\n
"
);
/*
* Now open the TOC file
*/
...
...
src/bin/pg_dump/pg_backup_null.c
浏览文件 @
e9751234
...
...
@@ -17,7 +17,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_null.c,v 1.
7 2001/06/27 21:21:37 petere
Exp $
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_null.c,v 1.
8 2002/04/24 02:21:04 momjian
Exp $
*
* Modifications - 09-Jul-2000 - pjw@rhyme.com.au
*
...
...
@@ -64,7 +64,6 @@ InitArchiveFmt_Null(ArchiveHandle *AH)
*/
if
(
AH
->
mode
==
archModeRead
)
die_horribly
(
AH
,
NULL
,
"this format cannot be read
\n
"
);
}
/*
...
...
src/bin/pg_dump/pg_backup_tar.c
浏览文件 @
e9751234
...
...
@@ -16,7 +16,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_tar.c,v 1.2
0 2001/10/28 06:25:58
momjian Exp $
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_tar.c,v 1.2
1 2002/04/24 02:21:04
momjian Exp $
*
* Modifications - 28-Jun-2000 - pjw@rhyme.com.au
*
...
...
@@ -157,6 +157,12 @@ InitArchiveFmt_Tar(ArchiveHandle *AH)
ctx
=
(
lclContext
*
)
malloc
(
sizeof
(
lclContext
));
AH
->
formatData
=
(
void
*
)
ctx
;
ctx
->
filePos
=
0
;
/* Initialize LO buffering */
AH
->
lo_buf_size
=
LOBBUFSIZE
;
AH
->
lo_buf
=
(
void
*
)
malloc
(
LOBBUFSIZE
);
if
(
AH
->
lo_buf
==
NULL
)
die_horribly
(
AH
,
modulename
,
"out of memory
\n
"
);
/*
* Now open the TOC file
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录