Re: [BUGS] Hmm, nodeUnique doesn't really support backwards scan too well

2008-08-07 Thread Gregory Stark
"Tom Lane" <[EMAIL PROTECTED]> writes: > Gregory Stark <[EMAIL PROTECTED]> writes: >> "Tom Lane" <[EMAIL PROTECTED]> writes: >>> Well, if you think it's easy, the best form of criticism is a patch. >>> The change-of-direction problem seems to me to be messy --- not >>> insoluble, but messy enough

Re: [BUGS] Hmm, nodeUnique doesn't really support backwards scan too well

2008-08-07 Thread Tom Lane
Gregory Stark <[EMAIL PROTECTED]> writes: > "Tom Lane" <[EMAIL PROTECTED]> writes: >> Well, if you think it's easy, the best form of criticism is a patch. >> The change-of-direction problem seems to me to be messy --- not >> insoluble, but messy enough to need beta testing. > Hm, I must have misun

Re: [BUGS] Hmm, nodeUnique doesn't really support backwards scan too well

2008-08-07 Thread Gregory Stark
"Tom Lane" <[EMAIL PROTECTED]> writes: > Gregory Stark <[EMAIL PROTECTED]> writes: >> "Tom Lane" <[EMAIL PROTECTED]> writes: >>> ... I'm not even sure how to fix it (the nasty case is >>> changing directions partway through the scan); let alone how to fix it in a >>> way that's obviously enough r

Re: [BUGS] Hmm, nodeUnique doesn't really support backwards scan too well

2008-08-06 Thread Tom Lane
Gregory Stark <[EMAIL PROTECTED]> writes: > "Tom Lane" <[EMAIL PROTECTED]> writes: >> ... I'm not even sure how to fix it (the nasty case is >> changing directions partway through the scan); let alone how to fix it in a >> way that's obviously enough right to make me feel comfortable in >> back-pa

Re: [BUGS] Hmm, nodeUnique doesn't really support backwards scan too well

2008-08-06 Thread Gregory Stark
"Tom Lane" <[EMAIL PROTECTED]> writes: > Gregory Stark <[EMAIL PROTECTED]> writes: >> Hm, that has the nasty side effect that someone who uses SCROLL but doesn't >> fetch backwards much or at all suddenly gets a much more expensive plan than >> if they didn't. > > Well, what are they using SCROLL

Re: [BUGS] Hmm, nodeUnique doesn't really support backwards scan too well

2008-08-06 Thread Tom Lane
Gregory Stark <[EMAIL PROTECTED]> writes: > Hm, that has the nasty side effect that someone who uses SCROLL but doesn't > fetch backwards much or at all suddenly gets a much more expensive plan than > if they didn't. Well, what are they using SCROLL for if they don't need it? A more plausible obj

Re: [BUGS] Hmm, nodeUnique doesn't really support backwards scan too well

2008-08-06 Thread Gregory Stark
"Tom Lane" <[EMAIL PROTECTED]> writes: > We could probably fix this by complicating the logic in ExecUnique, > but I wonder whether it wouldn't be better to just stop treating > Unique nodes as backwards-scannable. The only reason for that > node type to exist (as opposed to using Group nodes) is

Re: [BUGS] Hmm, nodeUnique doesn't really support backwards scan too well

2008-08-05 Thread Simon Riggs
On Tue, 2008-08-05 at 18:00 -0500, Jaime Casanova wrote: > On 8/5/08, Tom Lane <[EMAIL PROTECTED]> wrote: > > Simon Riggs <[EMAIL PROTECTED]> writes: > > > I've never seen anyone scan backwards like this at all in practical use. > > > > > I knew it was possible, but never seen it done. > > > > > I

Re: [BUGS] Hmm, nodeUnique doesn't really support backwards scan too well

2008-08-05 Thread Jaime Casanova
On 8/5/08, Tom Lane <[EMAIL PROTECTED]> wrote: > Simon Riggs <[EMAIL PROTECTED]> writes: > > I've never seen anyone scan backwards like this at all in practical use. > > > I knew it was possible, but never seen it done. > > > It seems entirely probable nobody else has either. It's a PostgreSQL > >

Re: [BUGS] Hmm, nodeUnique doesn't really support backwards scan too well

2008-08-05 Thread Tom Lane
Simon Riggs <[EMAIL PROTECTED]> writes: > I've never seen anyone scan backwards like this at all in practical use. > I knew it was possible, but never seen it done. > It seems entirely probable nobody else has either. It's a PostgreSQL > extension, so people arriving from outside don't even know

Re: [BUGS] Hmm, nodeUnique doesn't really support backwards scan too well

2008-08-05 Thread Simon Riggs
On Tue, 2008-08-05 at 13:07 -0400, Tom Lane wrote: > We could probably fix this by complicating the logic in ExecUnique, > but I wonder whether it wouldn't be better to just stop treating > Unique nodes as backwards-scannable. No problem there. > The only reason for that > node type to exist

[BUGS] Hmm, nodeUnique doesn't really support backwards scan too well

2008-08-05 Thread Tom Lane
In the regression database: regression=# select distinct on (ten) ten, thousand from tenk1 order by ten, thousand; ten | thousand -+-- 0 |0 1 |1 2 |2 3 |3 4 |4 5 |5 6 |6 7 |7 8 |8 9