Re: [PERFORM] Query Plan choice with timestamps

2008-08-07 Thread Giorgio Valoti
On 07/ago/08, at 23:01, Tom Lane wrote: Giorgio Valoti <[EMAIL PROTECTED]> writes: On 07/ago/08, at 17:50, Tom Lane wrote: These numbers seem pretty bogus: there is hardly any scenario in which a full-table indexscan should be costed as significantly cheaper than a seqscan. Have y

Re: [PERFORM] Query Plan choice with timestamps

2008-08-07 Thread Giorgio Valoti
On 07/ago/08, at 20:37, Giorgio Valoti wrote: […] If you haven't mucked with the cost parameters, the only way I can think of to get this result is to have an enormously bloated table that's mostly empty. Maybe you need to review your vacuuming procedures. I’ll review th

Re: [PERFORM] Query Plan choice with timestamps

2008-08-07 Thread Giorgio Valoti
On 07/ago/08, at 14:36, Richard Huxton wrote: Giorgio Valoti wrote: On 07/ago/08, at 10:35, Richard Huxton wrote: Giorgio Valoti wrote: Hi, I have a timestamptz field that I want to use with a query, but I don’t need the full timestamp resolution, so I’ve created a day_trunc(timestamptz

Re: [PERFORM] Query Plan choice with timestamps

2008-08-07 Thread Giorgio Valoti
On 07/ago/08, at 17:50, Tom Lane wrote: Giorgio Valoti <[EMAIL PROTECTED]> writes: GroupAggregate (cost=98431.58..119773.92 rows=74226 width=8) -> Sort (cost=98431.58..99050.92 rows=247736 width=8) Sort Key: (day_trunc(ts)) -> Seq Scan on blackbox

Re: [PERFORM] Query Plan choice with timestamps

2008-08-07 Thread Giorgio Valoti
On 07/ago/08, at 10:35, Richard Huxton wrote: Giorgio Valoti wrote: Hi, I have a timestamptz field that I want to use with a query, but I don’t need the full timestamp resolution, so I’ve created a day_trunc(timestamptz) immutable function which I’ll use with the query and with a new

[PERFORM] Query Plan choice with timestamps

2008-08-07 Thread Giorgio Valoti
6 rows=74226 width=8) -> Index Scan using test_2_idx on blackbox (cost=0.00..16943.16 rows=247736 width=8) But I fail to see why. Any hints? Thank you in advance -- Giorgio Valoti -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to yo

Re: [PERFORM] Views and functions returning sets of records

2008-03-23 Thread Giorgio Valoti
On 22/mar/08, at 17:55, Andreas Kretschmer wrote: Tom Lane <[EMAIL PROTECTED]> schrieb: Giorgio Valoti <[EMAIL PROTECTED]> writes: maybe it’s a naive question but I was wondering if there is any difference, from a performance point of view, between a view and a function perform

[PERFORM] Views and functions returning sets of records

2008-03-22 Thread Giorgio Valoti
WHERE fooid = $1; $$ LANGUAGE SQL; Thank you -- Giorgio Valoti -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance