Re: Delete query takes exorbitant amount of time - Mailing list pgsql-performance

From Tom Lane
Subject Re: Delete query takes exorbitant amount of time
Date
Msg-id 3340.1112117509@sss.pgh.pa.us
Whole thread Raw
In response to Re: Delete query takes exorbitant amount of time  (Simon Riggs <simon@2ndquadrant.com>)
Responses Re: Delete query takes exorbitant amount of time  (Simon Riggs <simon@2ndquadrant.com>)
List pgsql-performance
Simon Riggs <simon@2ndquadrant.com> writes:
> That implies to me that LIMIT queries are not considered correctly in
> the M&L formula and thus we are more likely to calculate a too-high cost
> for using an index in those circumstances....and thus more likely to
> SeqScan for medium sized relations?

You misunderstand how LIMIT is handled.  The plan structure is

    LIMIT ...
        regular plan ...

and so the strategy is to plan and cost the regular plan as though it
would be carried out in full, and then take an appropriate fraction
of that at the LIMIT stage.

            regards, tom lane

pgsql-performance by date:

Previous
From: Simon Riggs
Date:
Subject: Re: Delete query takes exorbitant amount of time
Next
From: Greg Stark
Date:
Subject: Re: How to improve db performance with $7K?