Note the report first line.  Interval is the primary key of both tables so
there is an internal index.
Table Forecast does the same but is not reported (because of the extra
unique constraints perhaps?)

The later two reported missing indexes are correct.

sqlite> .lint fkey-indexes
CREATE INDEX 'Actual_Interval' ON 'Actual'('Interval'); -->
Interval(Interval)
CREATE INDEX 'Generator_SrcType' ON 'Generator'('SrcType'); -->
Source(SrcType)
CREATE INDEX 'GeneratorSummary_Unit' ON 'GeneratorSummary'('Unit'); -->
Generator(Unit)

sqlite> .schema
CREATE TABLE Interval
(
    esoYear     integer not null check(esoYear between 1970 and 2038),
    esoMonth    integer not null check(esoMonth between 1 and 12),
    esoDay      integer not null check(esoDay between 1 and 31),
    esoHour     text collate nocase not null,
    Interval    integer primary key,
    unique (esoYear, esoMonth, esoDay, esoHour)
);
CREATE TABLE Forecast
(
    Interval    integer not null references Interval (Interval),
    Projected   integer not null references Interval (Interval)
check((Interval - Projected) between 0 and 2),
    UTCUpdate   integer,
    Price       float,
    Demand      integer,
    unique (Interval, Projected),
    unique (Projected, Interval)
);
CREATE TABLE Actual
(
    Interval    integer primary key references Interval (Interval),
    UTCUpdate   integer,
    Price       float,
    Demand      integer
);

_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to