Re: Planner doesn't look at LIMIT? - Mailing list pgsql-performance

From PFC
Subject Re: Planner doesn't look at LIMIT?
Date
Msg-id op.subgiji7th1vuj@localhost
Whole thread Raw
In response to Planner doesn't look at LIMIT?  (Dawid Kuroczko <qnex42@gmail.com>)
List pgsql-performance
    Which row do you want ? Do you want 'a row' at random ?
    I presume you want the N latest rows ?
    In that case you should use an ORDER BY on an indexed field, the serial
primary key will do nicely (ORDER BY id DESC) ; it's indexed so it will
use the index and it will fly.

> Any ideas how to make it work (other than rewriting the query to use
> subselects, use explicit id-rows, disabling hashjoin completely)?
> Or is this a bug?
>
>    Regards,
>       Dawid
>
> ---------------------------(end of broadcast)---------------------------
> TIP 9: In versions below 8.0, the planner will ignore your desire to
>        choose an index scan if your joining column's datatypes do not
>        match
>



pgsql-performance by date:

Previous
From: Dawid Kuroczko
Date:
Subject: Planner doesn't look at LIMIT?
Next
From: Tom Lane
Date:
Subject: Re: Planner doesn't look at LIMIT?