Changeset 368 for trunk/dns-1.0-1.2.sql


Ignore:
Timestamp:
07/26/12 18:18:22 (12 years ago)
Author:
Kris Deugau
Message:

/trunk

First stage implementation of export caching for performance. See #38.
A lot of the actual performance boost comes from indexes on a couple of
columns in WHERE clauses:

  • status column on domains and revzones
  • type, domain_id and rdns_id columns on records

Net speedup on ~100K records and ~3K zones was
~120s -> 20s (no cache) -> 4s (cache active)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dns-1.0-1.2.sql

    r366 r368  
    2727ALTER TABLE domains ALTER COLUMN changed SET DEFAULT true;
    2828ALTER TABLE domains ALTER COLUMN changed SET NOT NULL;
     29-- ~2x performance boost iff most zones are fed to output from the cache
     30CREATE INDEX dom_status_index ON domains (status);
    2931
    3032CREATE TABLE revzones (
     
    3840    changed boolean DEFAULT true NOT NULL
    3941);
     42CREATE INDEX rev_status_index ON revzones (status);
    4043
    4144ALTER TABLE log ADD COLUMN rdns_id INTEGER;
     
    4952UPDATE records SET rdns_id=0;
    5053ALTER TABLE records ALTER COLUMN rdns_id SET NOT NULL;
     54-- ~120s -> 75s performance boost on 100K records when always exporting all records
     55CREATE INDEX rec_types_index ON records (type);
     56-- Further ~1/3 performance gain, same dataset
     57CREATE INDEX rec_domain_index ON records (domain_id);
     58CREATE INDEX rec_revzone_index ON records (rdns_id);
    5159
    5260-- May as well drop and recreate;  this is nominally static and loaded from the
Note: See TracChangeset for help on using the changeset viewer.