al17nichols 0 Posted June 10, 2022 Is there a way to determine if localsql is using an index when running a query against an FDMemtable? Share this post Link to post
Lars Fosdal 1792 Posted June 10, 2022 In https://docwiki.embarcadero.com/RADStudio/Sydney/en/Local_SQL_(FireDAC) the "Query" section seems to indicate that it does not? Share this post Link to post
weirdo12 19 Posted June 10, 2022 Take a look at this line in the link Lars posted: CREATE INDEX / DROP INDEX. Instead of the SQL indexes, use the dataset indexes. Seems to me that means if the TFDMemTable has indexes they will be used. Share this post Link to post
Lars Fosdal 1792 Posted June 13, 2022 Quote The Local SQL engine supports SQLite SQL dialect with some limitations. The following SQL commands are not supported for the TDataSet data sources: ALTER TABLE ... ADD COLUMN. Instead, change the dataset structure. DROP TABLE. When a dataset is unlinked from the Local SQL engine, it is automatically dropped (not freed). CREATE INDEX / DROP INDEX. Instead of the SQL indexes, use the dataset indexes. CREATE TRIGGER / DROP TRIGGER. Instead of the triggers, use the dataset events. If you can programmatically add an index - i.e. without using SQL - it should work - but I've never tried it. Share this post Link to post