Re: [BUGS] BUG #4748: hash join and sort-merge join make different results

2009-04-03 Thread Tom Lane
Roman Kononov writes: > On 2009-04-03 23:32 Tom Lane said the following: >> Uh, what's your point? We have to match interval_eq, not >> justify_interval. > For any two intervals a and b, saying that interval_cmp_interval(a,b)==0 > is exactly the same as saying that (aj.month==bj.month && aj.day

Re: [BUGS] BUG #4748: hash join and sort-merge join make different results

2009-04-03 Thread Roman Kononov
On 2009-04-03 23:32 Tom Lane said the following: Roman Kononov writes: On 2009-04-03 14:57 Tom Lane said the following: I think we could fix this by having interval_hash() duplicate the total-span calculation done by interval_cmp_internal, and then return the hash of the resulting TimeOffset.

Re: [BUGS] BUG #4748: hash join and sort-merge join make different results

2009-04-03 Thread Tom Lane
"Roman Kononov" writes: > Description:hash join and sort-merge join make different results I've applied a patch for this: http://archives.postgresql.org/pgsql-committers/2009-04/msg00048.php Thanks for the report! regards, tom lane -- Sent via pgsql-bugs mailin

Re: [BUGS] BUG #4748: hash join and sort-merge join make different results

2009-04-03 Thread Tom Lane
Roman Kononov writes: > On 2009-04-03 14:57 Tom Lane said the following: >> I think we could fix this by having interval_hash() duplicate the >> total-span calculation done by interval_cmp_internal, and then return >> the hash of the resulting TimeOffset. This is going to break existing >> hash i

Re: [BUGS] BUG #4748: hash join and sort-merge join make different results

2009-04-03 Thread Roman Kononov
On 2009-04-03 14:57 Tom Lane said the following: I think we could fix this by having interval_hash() duplicate the total-span calculation done by interval_cmp_internal, and then return the hash of the resulting TimeOffset. This is going to break existing hash indexes on intervals, but there seem

Re: [BUGS] BUG #4748: hash join and sort-merge join make different results

2009-04-03 Thread Tom Lane
"Dickson S. Guedes" writes: > I could reproduce this once in a database that already have a table > named "t", then after i did dropped it i couldn't anymore. As noted, you might have to force use of a hash join (my machine preferred a mergejoin before the ANALYZE and a nestloop after). It's defi

Re: [BUGS] BUG #4748: hash join and sort-merge join make different results

2009-04-03 Thread Dickson S. Guedes
Em Sex, 2009-04-03 às 15:10 -0400, Alvaro Herrera escreveu: > Roman Kononov wrote: > > > Description:hash join and sort-merge join make different results > > Details: > > > > test-std=# create table t(s int,i interval); > > CREATE TABLE > > test-std=# insert into t values (0,'30 days'),

Re: [BUGS] BUG #4748: hash join and sort-merge join make different results

2009-04-03 Thread Tom Lane
Alvaro Herrera writes: > Roman Kononov wrote: >> Description:hash join and sort-merge join make different results >> Details: >> >> test-std=# create table t(s int,i interval); >> CREATE TABLE >> test-std=# insert into t values (0,'30 days'), (1,'1 month'); >> INSERT 0 2 >> test-std=# se

Re: [BUGS] BUG #4748: hash join and sort-merge join make different results

2009-04-03 Thread Jaime Casanova
On Fri, Apr 3, 2009 at 2:10 PM, Alvaro Herrera wrote: > Roman Kononov wrote: > >> Description:        hash join and sort-merge join make different results >> Details: >> >> test-std=# create table t(s int,i interval); >> CREATE TABLE >> test-std=# insert into t values (0,'30 days'), (1,'1 month');

Re: [BUGS] BUG #4748: hash join and sort-merge join make different results

2009-04-03 Thread Alvaro Herrera
Roman Kononov wrote: > Description:hash join and sort-merge join make different results > Details: > > test-std=# create table t(s int,i interval); > CREATE TABLE > test-std=# insert into t values (0,'30 days'), (1,'1 month'); > INSERT 0 2 > test-std=# select * from t as a, t as b where

[BUGS] BUG #4748: hash join and sort-merge join make different results

2009-04-03 Thread Roman Kononov
The following bug has been logged online: Bug reference: 4748 Logged by: Roman Kononov Email address: kono...@ftml.net PostgreSQL version: 8.3.7 Operating system: GNU/Linux x86_64 Description:hash join and sort-merge join make different results Details: test-std=# c