PROJET AUTOBLOG


Shaarli - Les discussions de Shaarli

Archivé

Site original : Shaarli - Les discussions de Shaarli du 23/07/2013

⇐ retour index

\timing on: Comparing two tables - Postgres

mercredi 17 juin 2015 à 18:02
Zertrin's links 17/06/2015
Say you have carefully tuned your database and wow! it is ten times faster -- but, before you push it to the production cluster, how do you know the answer of the query is correct?   Or at least, same as before?   :-)    You may have same question if you want to upgrade or migrate your database, or, for us, we want to make sure the new great join algorithm actually produce correct answer.   Well, let's just put the result before, and after, in two tables, and compare the two tables.

This is great, but turns out to be quite tricky.   You need to take care of the cases that,

    Either table may not have a primary key
    Rows in the two tables may be physically stored in different orders.
   Columns could contain nulls.
   The two tables could be huge, so performance must be good.

Here are something you could do.
(Permalink)