> -----Original Message-----
> From: andrew(at)socrates(dot)catalyst(dot)net(dot)nz
> Hiroshi Inoue wrote:
> > Hiroshi Inoue wrote:
> > > Andrew McMillan wrote:
> > > >
> > > > Hi,
> > > >
> > Sorry,it wouldn't help unless there's an index e.g. on (head1,written,
> > story_id, released, title, precis, author).
> > However isn't (story_id) a primary key ?
> > If so,couldn't you change your query as follows ?
> > SELECT story.story_id, written, released, title, precis, author, head1
> > FROM story WHERE head1=TRUE ORDER BY head1, written DESC
> > LIMIT 15.
> Thanks Hiroshi,
> I already have such an index, but as you can see below, it is still not
> newsroom=# explain SELECT story.story_id, written, released, title,
> precis, author, head1 FROM story WHERE head1=TRUE ORDER BY head1,
> written DESC LIMIT 15;
Oops,please add DESC to head1 also i.e ORDER BY head1 DESC,written DESC.
In response to
pgsql-hackers by date
|Next:||From: Grant Finnemore||Date: 2000-05-31 05:12:04|
|Subject: Re: SET FSYNC command?|
|Previous:||From: Andrew McMillan||Date: 2000-05-31 04:01:15|
|Subject: Re: Using BOOL in indexes|