Re: [PERFORM] significant slow down with various LIMIT

2010-04-22 Thread norn
On Apr 21, 9:52 pm, kevin.gritt...@wicourts.gov ("Kevin Grittner") wrote: > I wrote: > > ALTER TABLE ALTER plugins_guide_address > >   ALTER COLUMN city_id SET STATISTICS 1000; > > One too many ALTERs in there.  Should be: > > ALTER TABLE plugins_guide_address >   ALTER COLUMN city_id SET STATISTIC

Re: [PERFORM] significant slow down with various LIMIT

2010-04-22 Thread norn
> Try this: > > ALTER TABLE ALTER plugins_guide_address >   ALTER COLUMN city_id SET STATISTICS 1000; > ANALYZE plugins_guide_address; > > Then try your query. No luck... The same query time... > I have one more diagnostic query to test, if the above doesn't work: > > explain analyze > SELECT id F

Re: [PERFORM] significant slow down with various LIMIT

2010-04-20 Thread norn
Kevin, thanks for your time! Here the requested tests. > (1) Try it without the ORDER BY clause and the LIMIT. W/o the 'order by' it works instantly (about 1ms!) Limit (cost=0.00..3.59 rows=5 width=4) (actual time=0.127..0.229 rows=5 loops=1) -> Nested Loop (cost=0.00..277863.53 rows=386544

Re: [PERFORM] significant slow down with various LIMIT

2010-04-13 Thread norn
On Apr 13, 5:28 am, kevin.gritt...@wicourts.gov ("Kevin Grittner") wrote: > The cost settings help the optimizer make good decisions about plan > choice.  I guess I don't have much reason to believe, at this point, > that there is a better plan for it to choose for this query.  Do you > think you s

Re: [PERFORM] significant slow down with various LIMIT

2010-04-12 Thread norn
Kevin, I appreciate your help very much! > Since the LIMIT 3 and LIMIT 4 queries generated exactly the same > plan, the increased time for LIMIT 4 suggests that there are 3 > matching rows which are near the end of the index it is scanning, but > the fourth one is much farther in. Yes, you are rig

Re: [PERFORM] significant slow down with various LIMIT

2010-04-12 Thread norn
On Apr 10, 6:48 am, robertmh...@gmail.com (Robert Haas) wrote: > On Tue, Apr 6, 2010 at 8:42 PM, norn wrote: > > I have some mysterious slow downs with ORDER BY and LIMIT. When LIMIT > > getting greater than some value (greater than 3 in my case), query > > takes 4-5 secs i

Re: [PERFORM] significant slow down with various LIMIT

2010-04-09 Thread norn
Kevin, thanks for your attention! I've read SlowQueryQuestions, but anyway can't find bottleneck... Here requested information: OS: Ubuntu 9.10 64bit, Postgresql 8.4.2 with Postgis Hardware: AMD Phenom(tm) II X4 945, 8GB RAM, 2 SATA 750GB (pg db installed in software RAID 0) Please also note that

[PERFORM] significant slow down with various LIMIT

2010-04-08 Thread norn
Hi there! I have some mysterious slow downs with ORDER BY and LIMIT. When LIMIT getting greater than some value (greater than 3 in my case), query takes 4-5 secs instead of 0.25ms. All of the necessary indexes are in place. I have no idea what to do, so any advices are welcome! Here my queries an