如何从包含大量行的表中选择一行? [英] How to select a row from a table that has a lot of rows?

查看:97
本文介绍了如何从包含大量行的表中选择一行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用在Redhat5上运行的PostgreSQL 7.3.4


有一个表有一个断行,但现在我不知道哪一个坏了。该表有大约20974页。是否有一个命令来找到这个,因为我使用了select命令,如:select * from table order by column desc limit X;按列asc limit X从表顺序中选择*;但是一说到select * from table;它抛出一个错误,说不能读块。

I am using PostgreSQL 7.3.4 running on Redhat5

there is a table that has a broken row, but now I don''t know which one is broken. the table has about 20974 pages. is there a command to find this because I used select commands like: select * from table order by column desc limit X ; select * from table order by column asc limit X; but as soon as I say select * from table; it throws out an error, saying cann''t read block.

推荐答案

你真空吸尘了吗?是否有任何索引,如果这样重新创建它们。
Did you vacuum that table. Are there any indexes on it if so recreate them.


我试图真空并重新索引表但它一直说无法读取块。表中有索引.....非常感谢我将尝试重新创建索引
I tried to vacuum and reindex the table but it kept saying cannot read block. there are indexes in the table.....Many thanks I will try an recreate indexes


磁盘怎么样,你检查了坏块吗?
What about disk, did you check it for bad blocks?


这篇关于如何从包含大量行的表中选择一行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆