How to get started hacking on pgsql - Mailing list pgsql-hackers

From Greg Stark
Subject How to get started hacking on pgsql
Date
Msg-id 87ekvk4gd4.fsf@stark.dyndns.tv
Whole thread Raw
Responses Re: How to get started hacking on pgsql  (Hannu Krosing <hannu@tm.ee>)
Re: How to get started hacking on pgsql  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
I have an idea for what I think may be a very simple optimization for postgres
to make. I would like to try my hand at implementing it, but the last time I
tried I apparently started off in the wrong direction. 

In the following query, the sort step is completely unnecessary. The order is
already guaranteed by the index:


test=# create table test (a integer,b integer);
CREATE TABLE
test=# create index test_i on test(a,b);
CREATE INDEX
test=# explain select * from test where a=1 order by b;                              QUERY PLAN
      
 
-------------------------------------------------------------------------Sort  (cost=5.95..5.96 rows=6 width=8)  Sort
Key:b  ->  Index Scan using test_i on test  (cost=0.00..5.87 rows=6 width=8)        Index Cond: (a = 1)
 
(4 rows)



At what point in the process would it make sense to check for this?
Where should I be looking in the code?

-- 
greg



pgsql-hackers by date:

Previous
From: Steve Wampler
Date:
Subject: Re: Minor (very) feature request...
Next
From: Gaetano Mendola
Date:
Subject: Re: rebuilding rpm for RH9 error