Page 1 of 1

select on indexes

Posted: Thu 02 Oct 2008 13:58
by zvasku
Hello,

we are using TUniQuery and TClientDataset-TDatasetProvider-TUniQuery.
Is it possible (or add this feature) to disable internal queries on indexes to speedup application. For examaple:

SELECT '' TABLE_CATALOG, IC.TABLE_OWNER TABLE_SCHEMA, IC.TABLE_NAME, '' INDEX_CATALOG, IC.INDEX_OWNER INDEX_SCHEMA, IC.INDEX_NAME, IC.COLUMN_NAME, IC.COLUMN_POSITION, DECODE(IC.DESCEND, 'ASC', 0, 1) DESCENDING
FROM SYS.ALL_IND_COLUMNS IC, SYS.ALL_INDEXES I
WHERE IC.TABLE_OWNER = 'SEIWIN5' AND IC.TABLE_NAME = 'HSFT_TAB158' AND I.UNIQUENESS = 'UNIQUE' AND I.OWNER = IC.INDEX_OWNER AND I.INDEX_NAME = IC.INDEX_NAME ORDER BY IC.INDEX_OWNER, IC.TABLE_OWNER, IC.TABLE_NAME, IC.INDEX_NAME, IC.COLUMN_POSITION

We have build in application which fields are in update where clause (more then in index) and we are need Required property in TField only.
In dbexpress there is GetMetaData property for this purpose.

Thanks a lot
Zdenek

Posted: Fri 03 Oct 2008 12:57
by Plash
Set the KeyFields property of TUniQuery to prevent the query for the indexes metadata.

Posted: Fri 03 Oct 2008 14:00
by zvasku
It works ok, but I have to specify it for every uniquery separately (over 100+ tclientdatasets-tdatasetprovider-tuniquery). Is it possible to add this as feature?

Thanks
Zdenek

Posted: Mon 06 Oct 2008 07:55
by Plash
We'll fix this problem in the next build of UniDAC.

Re:

Posted: Fri 07 Aug 2015 18:59
by pimentel_flores
Plash wrote:We'll fix this problem in the next build of UniDAC.
Hello. Did you fix this problem?
I'm running Unidac 4.6.12 For Delphi 2007

everytime i do a uniquery.execute i see the below query being executed, and it is logged by mysql as an non optimal query, how to fix this, i need my app to run faster and seems that this query is causing performance issues.

also my tuniquerys cannot be static, they change the sql.text property on the fly so everytime they call different tables so i cannot set the keyfields static

SELECT cast('' as char(1)) TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME, COLUMN_NAME, ORDINAL_POSITION POSITION, DATA_TYPE, CHARACTER_MAXIMUM_LENGTH DATA_LENGTH, NUMERIC_PRECISION DATA_PRECISION, NUMERIC_SCALE DATA_SCALE, (case IS_NULLABLE when 'YES' then 1 else 0 end) NULLABLE, COLUMN_DEFAULT DEFAULT_VALUE FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = 'mq_gpojamco' AND TABLE_NAME = 'TABLENAME' ORDER BY TABLE_SCHEMA, TABLE_NAME, ORDINAL_POSITION;
# Query_time: 0.000588 Lock_time: 0.000149 Rows_sent: 0 Rows_examined: 422

Re: select on indexes

Posted: Mon 10 Aug 2015 09:26
by AlexP
hello,

Unfortunately, we can't generate correct queries without retrieving metadata. We are working on increasing performance of such queries. We will change these queries in one of the next versions.