Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Did you read the PostgreSQL documentation for "<a href="http://www.postgresql.org/docs/8.3/static/using-explain.html" rel="nofollow noreferrer">Using EXPLAIN</a>", to interpret the output you're showing?</p> <p>I'm not a regular PostgreSQL user, but I just read that doc, and then compared to the <code>EXPLAIN</code> output you're showing. Your <code>UPDATE</code> query seems to be using no indexes, and it's forced to do table-scans to sort both <code>page</code> and <code>pagelinks</code>. The sort is no doubt large enough to need temporary disk files, which I think are created under your <code>temp_tablespace</code>.</p> <p>Then I see the estimated database pages read. The top-level of that <code>EXPLAIN</code> output says <code>(cost=127710692.21..135714045.43)</code>. The units here are in disk I/O accesses. So it's going to access the disk over 135 million times to do this <code>UPDATE</code>. </p> <p>Note that even 10,000rpm disks with 5ms seek time can achieve at best 200 I/O operations per second under optimal conditions. This would mean that your <code>UPDATE</code> would take 188 hours (7.8 days) of disk I/O, even if you could sustain saturated disk I/O for that period (i.e. continuous reads/writes with no breaks). This is impossible, and I'd expect the actual throughput to be off by at least an order of magnitude, especially since you have no doubt been using this server for all sorts of other work in the meantime. So I'd guess you're only a fraction of the way through your <code>UPDATE</code>.</p> <p>If it were me, I would have killed this query on the first day, and found another way of performing the <code>UPDATE</code> that made better use of indexes and didn't require on-disk sorting. You probably can't do it in a single SQL statement.</p> <p>As for your <code>DROP INDEX</code>, I would guess it's simply blocking, waiting for exclusive access to the table, and while it's in this state I think you can probably kill it.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload