Re: Limit clause not using index

From: Yves Vindevogel <yves(dot)vindevogel(at)implements(dot)be>
To: pgsql-performance(at)postgresql(dot)org
Subject: Re: Limit clause not using index
Date: 2005-06-21 15:10:23
Message-ID: 163f181d17f10b89bf136ab9a5a7a81c@implements.be
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Nevermind guys ....
There's an error in a function that is creating these indexes.
The function never completed succesfully so the index is not there

Very sorry about this !!

On 21 Jun 2005, at 16:57, Yves Vindevogel wrote:

> These are my indexes
>
> create index ixprintjobsapplicationtype on tblPrintjobs
> (applicationtype);
> create index ixprintjobsdesceventdate on tblPrintjobs (desceventdate);
> create index ixprintjobsdesceventtime on tblPrintjobs (desceventtime);
> create index ixprintjobsdescpages on tblPrintjobs (descpages);
> create index ixprintjobsdocumentname on tblPrintjobs (documentname) ;
> create index ixprintjobseventcomputer on tblPrintjobs (eventcomputer);
> create index ixprintjobseventdate on tblPrintjobs (eventdate);
> create index ixprintjobseventtime on tblPrintjobs (eventtime);
> create index ixprintjobseventuser on tblPrintjobs (eventuser);
> create index ixprintjobshostname on tblPrintjobs (hostname) ;
> create index ixprintjobsipaddress on tblPrintjobs (ipaddress) ;
> create index ixprintjobsloginuser on tblPrintjobs (loginuser) ;
> create index ixprintjobspages on tblPrintjobs (pages) ;
> create index ixprintjobsprintport on tblPrintjobs (printport) ;
> create index ixprintjobsprintqueue on tblPrintjobs (printqueue) ;
> create index ixprintjobsrecordnumber on tblPrintjobs (recordnumber) ;
> create index ixprintjobssize on tblPrintjobs (size) ;
> create index ixprintjobsusertype on tblPrintjobs (usertype) ;
> create index ixPrintjobsDescpagesDocumentname on tblPrintjobs
> (descpages, documentname) ;
> create index ixPrintjobsHostnamePrintqueueDesceventdateDesceventtime
> on tblPrintjobs (hostname, printqueue, desceventdate, desceventtime) ;
> create index ixPrintjobsLoginDescEventdateDesceventtime on
> tblPrintjobs (loginuser, desceventdate, desceventtime) ;
>
>
> On 21 Jun 2005, at 16:42, Tom Lane wrote:
>
>> Yves Vindevogel <yves(dot)vindevogel(at)implements(dot)be> writes:
>>> Can anyone explain me this ?
>>
>>> rvponp=# explain select * from tblprintjobs order by loginuser,
>>> desceventdate, desceventtime offset 25 limit 25 ;
>>> QUERY PLAN
>>> ---------------------------------------------------------------------
>>> ---
>>> -----------
>>> Limit (cost=349860.62..349860.68 rows=25 width=206)
>>> -> Sort (cost=349860.56..351416.15 rows=622236 width=206)
>>> Sort Key: loginuser, desceventdate, desceventtime
>>> -> Seq Scan on tblprintjobs (cost=0.00..25589.36
>>> rows=622236 width=206)
>>> (4 rows)
>>
>>
>> Do you have an index matching that sort key? I'd certainly expect the
>> above to use it if it were there. For the full table case it's not so
>> clear --- an indexscan isn't always better.
>>
>> regards, tom lane
>>
>>
> Met vriendelijke groeten,
> Bien à vous,
> Kind regards,
>
> Yves Vindevogel
> Implements
>
> <Pasted Graphic 2.tiff>
>
> Mail: yves(dot)vindevogel(at)implements(dot)be - Mobile: +32 (478) 80 82 91
>
> Kempische Steenweg 206 - 3500 Hasselt - Tel-Fax: +32 (11) 43 55 76
>
> Web: http://www.implements.be
>
> First they ignore you. Then they laugh at you. Then they fight you.
> Then you win.
> Mahatma Ghandi.
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 8: explain analyze is your friend
>
Met vriendelijke groeten,
Bien à vous,
Kind regards,

Yves Vindevogel
Implements

Attachment Content-Type Size
Pasted Graphic 2.tiff image/tiff 5.6 KB

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message John A Meinel 2005-06-21 15:14:24 Re: Limit clause not using index
Previous Message Yves Vindevogel 2005-06-21 15:07:54 Re: Limit clause not using index