select on indexes

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
zvasku
Posts: 77
Joined: Tue 19 Sep 2006 12:04

select on indexes

Post by zvasku » Thu 02 Oct 2008 13:58

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

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Fri 03 Oct 2008 12:57

Set the KeyFields property of TUniQuery to prevent the query for the indexes metadata.

zvasku
Posts: 77
Joined: Tue 19 Sep 2006 12:04

Post by zvasku » Fri 03 Oct 2008 14:00

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

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Mon 06 Oct 2008 07:55

We'll fix this problem in the next build of UniDAC.

pimentel_flores
Posts: 31
Joined: Wed 15 Aug 2007 16:30
Location: mexico

Re:

Post by pimentel_flores » Fri 07 Aug 2015 18:59

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

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: select on indexes

Post by AlexP » Mon 10 Aug 2015 09:26

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.

Post Reply