[GENERAL] Querying on partitioned tables

2008-10-15 Thread Peter Vanderborght
Hi, I've recently split my log table into time-based partitions, which really improves insert speed and query times for certain queries. However, I can't help thinking the query optimizer is really suboptimal here. My partitions look like this: CREATE TABLE log_cdf ( id serial NOT NULL, tsta

Re: [GENERAL] The optimizer is too smart for me - How can I trick it?

2008-05-30 Thread Peter Vanderborght
GREAT!!! Just "offset 0" in the subquery did the trick! I had already been playing with a stored proc, but that's way more messy than this. Thanks a million! Peter -Original Message- From: Adam Rich [mailto:[EMAIL PROTECTED] Sent: 30 May 2008 17:14 To: [EMAIL PROTECTED]; pgsql-genera

[GENERAL] The optimizer is too smart for me - How can I trick it?

2008-05-30 Thread Peter Vanderborght
Hi, I've implemented Depesz's running total function (http://www.depesz.com/index.php/2007/08/17/rownum-anyone-cumulative-sum-in- one-query/) in my DB, which works great. Now what I want to do is get the running total for a certain statement and then do a subselect on that result so to get a non-