Re: limit /offset - Mailing list pgsql-general

From Pirtea Calin
Subject Re: limit /offset
Date
Msg-id 000e01c1cd0d$757deb60$0100a8c0@dizzy
Whole thread Raw
In response to Re: limit /offset  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
List pgsql-general
> > but when i use offset in the same statement
> >     select * from detail2 where id>125000 order by info1 limit 10 offset
> > 10000
> > the plan changes
> >     Limit (cost=36.47..36.47 rows=1 width=52)
> >         -> Sort (cost=36.47..36.47 rows=333 width=52)
> >             -> Seq Scan on detail2 (cost=0.00..22.50 rows=333 width=52)
> > and it takes almost 50 seconds to complete (42.890 sec)
> > Can anyone explain why offset doesn't use the index available?
> >
>
> How many rows does detail2 have? What does explain say for the query and
> how long does it take if you set enable_seqscan=off before it?
>


It doesn't change the explain when i try
set enable_seqscan=off;
select * from detail2 where id>125000 order by info1 limit 10 offset 10000;

And it still takes 42+ seconds

the table has 250000 records.

Thanks in advance.


Best regards,
Aplication Developer
Pirtea Calin Iancu
S.C. SoftScape S.R.L.
pcalin@rdsor.ro


pgsql-general by date:

Previous
From: Stephan Szabo
Date:
Subject: Re: limit /offset
Next
From: "Jonathan Ellis"
Date:
Subject: locking problems