John English <[email protected]> writes: > On 20/12/2012 14:12, Jean-Yves Linet wrote: >> Hi, >> May you could give more details about the structure of your table. > > The table looks like this: > > CREATE TABLE system_log ( > id INTEGER GENERATED ALWAYS AS IDENTITY, > time TIMESTAMP DEFAULT NULL, > username VARCHAR(15), > facility VARCHAR(15) NOT NULL, > event VARCHAR(31) NOT NULL, > module VARCHAR(15), > test VARCHAR(255), > details VARCHAR(32000), > CONSTRAINT systemlog_pk PRIMARY KEY (id) > ); > > I'm actually displaying a formatted view of the table:
If you run the query with derby.language.logQueryPlan=true and check derby.log, does the query plan say that log_index is used? Does it change anything if you access the table directly instead of via the view? I think we've had reports that the optimizer cannot always see through the views and misses out on some opportunities for optimization. -- Knut Anders
