10.09.2015 Views

Migrating Uber from MySQL to PostgreSQL

uber_migration_pypgday_2013

uber_migration_pypgday_2013

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Code Changes<br />

Implicit Ordering (cont.)<br />

SELECT * FROM trips WHERE status =<br />

’completed’;<br />

Without an index on status, the query scans the rows in<br />

PK order, so the same implicit ordering on id will occur.<br />

With an index on status, the query scans the row in<br />

order of (status, id), and thus there is still an<br />

implicit ordering on id! (This would not be true for a<br />

“range” query, however.)<br />

Evan Klitzke (<strong>Uber</strong>, Inc.) <strong>Migrating</strong> <strong>Uber</strong> <strong>from</strong> <strong>MySQL</strong> <strong>to</strong> <strong>PostgreSQL</strong> March 13, 2013 42 / 59

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!