pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PFC <lists@boutiquenumerique.com>
To: Dawid Kuroczko <qnex42@gmail.com>
To: Postgresql Performance <pgsql-performance@postgresql.org>
Subject: Re: Planner doesn't look at LIMIT?
Date: Fri, 22 Jul 2005 15:16:57 +0200
Message-ID: <op.subgiji7th1vuj@localhost> (raw)
In-Reply-To: <758d5e7f0507220210bfa4978@mail.gmail.com>
References: <758d5e7f0507220210bfa4978@mail.gmail.com>


	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
>





view thread (13+ messages)  latest in thread

Message-ID: <op.subgiji7th1vuj@localhost>
Permalink:  ../op.subgiji7th1vuj@localhost/
Also on:    postgresql.org/message-id/op.subgiji7th1vuj@localhost

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: lists@boutiquenumerique.com, qnex42@gmail.com
  Subject: Re: Planner doesn't look at LIMIT?
  In-Reply-To: <op.subgiji7th1vuj@localhost>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox