Re: [PERFORM] Slow query when using ORDER BY *and* LIMIT

2011-10-15 Thread Michael Viscuso
Dave, Since I control the application that was performing the query and I've separated my data into daily partitioned tables (which enforced my order by clause on a macro-level), I took Stephen's advice and implemented the nested loop over each daily table from within the application versus having

Re: [PERFORM] Query optimization using order by and limit

2011-09-22 Thread Michael Viscuso
, Sep 22, 2011 at 7:14 PM, Stephen Frost wrote: > Mike, > > * Michael Viscuso (michael.visc...@getcarbonblack.com) wrote: > > I spent the better part of the day implementing an application layer > > nested loop and it seems to be working well. Of course it's a little

Re: [PERFORM] Query optimization using order by and limit

2011-09-22 Thread Michael Viscuso
, it's a simple flag in my application to query the other way again... Thanks for all your help - and I'm still looking to change those numerics to bigints, just haven't figured out the best way yet. Mike On 9/22/2011 10:53 AM, Stephen Frost wrote: > * Michael Viscuso (mic

Re: [PERFORM] Query optimization using order by and limit

2011-09-22 Thread Michael Viscuso
d Postgres performance so I could be mistaken.) Regardless, in the meantime, I'll switch those columns to bigint instead of numeric and have an update as soon as possible. Thanks for your help! Mike On 9/22/2011 9:41 AM, k...@rice.edu wrote: > On Wed, Sep 21, 2011 at 11:22:53PM -0400, Tom Lane wro

Re: [PERFORM] Query optimization using order by and limit

2011-09-21 Thread Michael Viscuso
Thanks guys, First of all, I should have included my postgres.conf file with the original submission. Sorry about that. It is now attached. Based on a recommendation, I also should have shown the parent child relationship between osmoduleloads and its daily partitioned tables. to reduce clutte

[PERFORM] Query optimization using order by and limit

2011-09-21 Thread Michael Viscuso
First of all, thank you for taking the time to review my question. After attending the PostgresOpen conference in Chicago last week, I've been pouring over explain logs for hours on end and although my system is MUCH better, I still can't resolve a few issues. Luckily my data is pretty well struc