Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
25deba31
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,发现更多精彩内容 >>
提交
25deba31
编写于
2月 01, 2005
作者:
B
Bruce Momjian
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Update LIMIT/FETCH FAQ item.
上级
0a92c58b
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
19 addition
and
33 deletion
+19
-33
doc/FAQ
doc/FAQ
+8
-15
doc/src/FAQ/FAQ.html
doc/src/FAQ/FAQ.html
+11
-18
未找到文件。
doc/FAQ
浏览文件 @
25deba31
Frequently Asked Questions (FAQ) for PostgreSQL
Last updated: Mon Jan 31
19:18:44
EST 2005
Last updated: Mon Jan 31
20:35:58
EST 2005
Current maintainer: Bruce Momjian (pgman@candle.pha.pa.us)
...
...
@@ -445,17 +445,13 @@
PostgreSQL releases?
The PostgreSQL team makes only small changes between minor releases,
so upgrading from 7.
2 to 7.2
.1 does not require a dump and restore.
However, major releases (e.g. from 7.
2 to 7.3
) often change the
so upgrading from 7.
4 to 7.4
.1 does not require a dump and restore.
However, major releases (e.g. from 7.
3 to 7.4
) often change the
internal format of system tables and data files. These changes are
often complex, so we don't maintain backward compat
a
bility for data
often complex, so we don't maintain backward compat
i
bility for data
files. A dump outputs data in a generic format that can then be loaded
in using the new internal format.
In releases where the on-disk format does not change, the pg_upgrade
script can be used to upgrade without a dump/restore. The release
notes mention whether pg_upgrade is available for the release.
3.8) What computer hardware should I use?
Because PC hardware is mostly compatible, people tend to believe that
...
...
@@ -471,13 +467,10 @@
4.1) How do I SELECT only the first few rows of a query? A random row?
See the FETCH manual page, or use SELECT ... LIMIT....
The entire query may have to be evaluated, even if you only want the
first few rows. Consider using a query that has an ORDER BY. If there
is an index that matches the ORDER BY, PostgreSQL may be able to
evaluate only the first few records requested, or the entire query may
have to be evaluated until the desired rows have been generated.
To retrieve only a few rows, if you know at the number of rows needed
at the time of the SELECT use LIMIT . If an index matches the ORDER BY
it is possible the entire query does not have to be executed. If you
don't know the number of rows at SELECT time, use a cursor and FETCH.
To SELECT a random row, use:
SELECT col
...
...
doc/src/FAQ/FAQ.html
浏览文件 @
25deba31
...
...
@@ -10,7 +10,7 @@
alink=
"#0000ff"
>
<H1>
Frequently Asked Questions (FAQ) for PostgreSQL
</H1>
<P>
Last updated: Mon Jan 31
19:18:44
EST 2005
</P>
<P>
Last updated: Mon Jan 31
20:35:58
EST 2005
</P>
<P>
Current maintainer: Bruce Momjian (
<A
href=
"mailto:pgman@candle.pha.pa.us"
>
pgman@candle.pha.pa.us
</A>
)
...
...
@@ -590,18 +590,13 @@
to upgrade between major PostgreSQL releases?
</H4>
<P>
The PostgreSQL team makes only small changes between minor releases,
so upgrading from 7.
2 to 7.2
.1 does not require a dump and restore.
However, major releases (e.g. from 7.
2 to 7.3
) often change the internal
so upgrading from 7.
4 to 7.4
.1 does not require a dump and restore.
However, major releases (e.g. from 7.
3 to 7.4
) often change the internal
format of system tables and data files. These changes are often complex,
so we don't maintain backward compat
a
bility for data files. A dump outputs
so we don't maintain backward compat
i
bility for data files. A dump outputs
data in a generic format that can then be loaded in using the new internal
format.
</P>
<P>
In releases where the on-disk format does not change, the
<I>
pg_upgrade
</I>
script can be used to upgrade without a dump/restore.
The release notes mention whether
<I>
pg_upgrade
</I>
is available for the
release.
</P>
<H4><A
name=
"3.8"
>
3.8
</A>
) What computer hardware should I use?
</H4>
<P>
Because PC hardware is mostly compatible, people tend to believe that
...
...
@@ -619,15 +614,13 @@
<H4><A
name=
"4.1"
>
4.1
</A>
) How do I
<SMALL>
SELECT
</SMALL>
only the
first few rows of a query? A random row?
</H4>
<P>
See the
<SMALL>
FETCH
</SMALL>
manual page, or use
<SMALL>
SELECT
</SMALL>
...
<SMALL>
LIMIT
</SMALL>
....
</P>
<P>
The entire query may have to be evaluated, even if you only want
the first few rows. Consider using a query that has an
<SMALL>
ORDER
BY
</SMALL>
. If there is an index that matches the
<SMALL>
ORDER
BY
</SMALL>
, PostgreSQL may be able to evaluate only the first few
records requested, or the entire query may have to be evaluated
until the desired rows have been generated.
</P>
<P>
To retrieve only a few rows, if you know at the number of rows
needed at the time of the
<SMALL>
SELECT
</SMALL>
use
<SMALL>
LIMIT
</SMALL>
. If an index matches the
<SMALL>
ORDER
BY
</SMALL>
it is possible the entire query does not have to be
executed. If you don't know the number of rows at
<SMALL>
SELECT
</SMALL>
time, use a cursor and
<SMALL>
FETCH
</SMALL>
.
</P>
<P>
To
<SMALL>
SELECT
</SMALL>
a random row, use:
<PRE>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录