On Jan 13, 2008 8:58 PM, pepone. onrez <pepone.onrez@gmail.com> wrote:
> I have this query in a table with 150 thowsand tuples and it takes to long
>
> t_documentcontent._id AS _id
> FROM t_documentcontent LIMIT 50 OFFSET 80000
>
> here is the explain output
>
> "Limit (cost= 100058762.30..100058799.02 rows=50 width=58) (actual
> time=19433.474..19433.680 rows=50 loops=1)"
> " -> Seq Scan on t_documentcontent (cost=100000000.00..100110772.07
> rows=150807 width=58) (actual time=53.934..19402.030 rows=80050 loops=1)"
> "Total runtime: 19433.748 ms"
looks like you've set enable_seqscan=off. When looking for help on
queries it's a good idea to mention such things...
with no order by, and possibly no index on t_documentcontent._id,
there's no choice but a seq scan.
try adding both.