Re: Planner doesn't look at LIMIT?

From: PFC
Subject: Re: Planner doesn't look at LIMIT?
Date: ,
Msg-id: op.subgiji7th1vuj@localhost
(view: Whole thread, Raw)
In response to: Planner doesn't look at LIMIT?  (Dawid Kuroczko)
List: pgsql-performance

Tree view

Planner doesn't look at LIMIT?  (Dawid Kuroczko, )
 Re: Planner doesn't look at LIMIT?  (PFC, )
 Re: Planner doesn't look at LIMIT?  (Tom Lane, )
  Re: Planner doesn't look at LIMIT?  (Dawid Kuroczko, )
  Re: Planner doesn't look at LIMIT?  (Tom Lane, )
   Re: [HACKERS] Planner doesn't look at LIMIT?  (Simon Riggs, )
    Re: [HACKERS] Planner doesn't look at LIMIT?  (Tom Lane, )
     Re: [HACKERS] Planner doesn't look at LIMIT?  (Sam Mason, )
   Re: Planner doesn't look at LIMIT?  (Dawid Kuroczko, )
   Re: Planner doesn't look at LIMIT?  (Ian Westmacott, )
    Re: Planner doesn't look at LIMIT?  (Tom Lane, )
     Re: Planner doesn't look at LIMIT?  (Ian Westmacott, )
 Re: Planner doesn't look at LIMIT?  (Sam Mason, )

    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:

From: Tom Lane
Date:
Subject: Re: [HACKERS] Planner doesn't look at LIMIT?
From: Mark Wong
Date:
Subject: Re: [PATCHES] COPY FROM performance improvements