Hi,

I have the following table with index on 'resource_id':

CREATE TABLE IF NOT EXISTS sw_stream_resource_assoc(
        data_id INT NOT NULL,
        resource_id VARCHAR NOT NULL,
        FOREIGN KEY(data_id) REFERENCES sw_stream_data(id) ON UPDATE CASCADE
ON DELETE CASCADE,
        FOREIGN KEY(resource_id) REFERENCES sw_stream_resources(id) ON UPDATE
CASCADE ON DELETE CASCADE,
);
CREATE INDEX IF NOT EXISTS sw_stream_resource_assoc_idx1 ON
sw_stream_resource_assoc(resource_id);

When running:
EXPLAIN SELECT resource_id FROM sw_stream_resource_assoc

the output is:
SELECT
    RESOURCE_ID
FROM PUBLIC.SW_STREAM_RESOURCE_ASSOC
    /* PUBLIC.SW_STREAM_RESOURCE_ASSOC.tableScan */

which means that index is not used.
Do you have an idea why is that?

H2 version: 1.3.158

Thanks!
Michael

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/h2-database?hl=en.

Reply via email to