Re: [PERFORM] Planner issue on sorting joining of two tables with limit

2010-05-16 Thread Robert Haas
On Fri, May 7, 2010 at 11:35 AM, Tom Lane wrote: > "Kevin Grittner" writes: >> Alexander Korotkov wrote: I just don't find why it is coincidence. I think that such plan will always produce result ordered by two columns, because such nested index scan always produce this result. >

Re: [PERFORM] Planner issue on sorting joining of two tables with limit

2010-05-07 Thread Tom Lane
"Kevin Grittner" writes: > Alexander Korotkov wrote: >>> I just don't find why it is coincidence. I think that such plan >>> will always produce result ordered by two columns, because such >>> nested index scan always produce this result. > Assuming a nested index scan, or any particular plan,

Re: [PERFORM] Planner issue on sorting joining of two tables with limit

2010-05-07 Thread Kevin Grittner
Alexander Korotkov wrote: > Alexander Korotkov wrote: >>> Well, no, because that plan wouldn't produce the specified >>> ordering; or at least it would be a lucky coincidence if it did. >>> It's only sorting on t1.value. >>> >> I just don't find why it is coincidence. I think that such plan >>

Re: [PERFORM] Planner issue on sorting joining of two tables with limit

2010-05-07 Thread Alexander Korotkov
I found my mistake. My supposition is working only if value column in t1 table is unique. But if I replace the index by unique one then plan is the same. On Mon, May 3, 2010 at 5:57 PM, Alexander Korotkov wrote: > Well, no, because that plan wouldn't produce the specified ordering; >> or at least

Re: [PERFORM] Planner issue on sorting joining of two tables with limit

2010-05-07 Thread Alexander Korotkov
> > Well, no, because that plan wouldn't produce the specified ordering; > or at least it would be a lucky coincidence if it did. It's only > sorting on t1.value. > I just don't find why it is coincidence. I think that such plan will always produce result ordered by two columns, because such neste

Re: [PERFORM] Planner issue on sorting joining of two tables with limit

2010-04-26 Thread Tom Lane
=?KOI8-R?B?68/Sz9TLz9cg4czFy9PBzsTS?= writes: > So PostgreSQL planner can produce the plan I need but it doesn't produce > this plan when I specify particular second ordering column. Well, no, because that plan wouldn't produce the specified ordering; or at least it would be a lucky coincidence i

[PERFORM] Planner issue on sorting joining of two tables with limit

2010-04-26 Thread Коротков Александр
Hello, everybody! I'm using PostgreSQL 8.4.3, compiled by Visual C++ build 1400, 32-bit on Windows XP SP3. I use following data model for issue reproducing. CREATE TABLE test1 ( id integer NOT NULL, "value" double precision, CONSTRAINT test1_pkey PRIMARY KEY (id) ); CREATE INDEX test1_valu