Unidac 4.1->5.0 performance degradation with PostgreSQL
Posted: Mon 20 May 2013 04:41
We migrated from UniDAC 4.1 to 5.0 (simply rebuilded our app with new version) and catch huge degradation in our datapump routines.
Running pgfouine catch many queries like:
It executes more than 1,100,000 times for 210,000 data inserts. (on each field assignment, I think).
Why it had happened and how avoid it on current version?
We does TUniQuery.Prepare once before insert loop and reassign query params inside like this:
On UniDAC 4.1 it works fine.
Running pgfouine catch many queries like:
Code: Select all
SELECT current_database() AS DATATYPE_CATALOG,
n.nspname AS DATATYPE_SCHEMA,
t.typname AS DATATYPE_NAME,
t.oid AS DATATYPE_OID,
t.typlen AS DATATYPE_LENGTH,
CASE WHEN t.typtype = 'b' THEN 'base'
WHEN t.typtype = 'c' THEN 'composite'
WHEN t.typtype = 'd' THEN 'domain'
WHEN t.typtype = 'e' THEN 'enum'
WHEN t.typtype = 'p' THEN 'pseudo'
END::varchar(9) AS DATATYPE_TYPE,
t.typrelid AS TABLE_OID,
t.typbasetype AS DATATYPE_BASETYPE
FROM pg_type t
INNER JOIN pg_namespace n ON n.oid = t.typnamespace
WHERE t.oid = '' AND t.typtype = ''
ORDER BY n.nspname, t.typname;
Why it had happened and how avoid it on current version?
We does TUniQuery.Prepare once before insert loop and reassign query params inside like this:
Code: Select all
ParCtr := Math.Min(qu.Params.Count - 1, High(VarParams));
for i := 0 to ParCtr do
if not VarIsEmpty(VarParams[i]) then
qu.Params[i].Value := VarParams[i]
else qu.Params[i].Clear;
qu.Execute