Subject | Database and transaction parameters |
---|---|
Author | Svend Meyland Nicolaisen |
Post date | 2004-04-06T20:17:07Z |
Many database parameter constants and some transaction parameter constants
are listed in the source code for the IB components that are shipped with
Delphi that isn't descriped in the InterBase 6 API guide. Is this because
they isn't supported or just because they isn't documented?
Some database parameters are mentioned in the API guide but not descriped.
For example for how do I use the constants isc_dpb_license,
isc_dpb_encrypt_key, and isc_dpb_sql_role_name?
Is there any other place where these constants are descriped in detail
(apart from the source code for FB)?
-
SMN
are listed in the source code for the IB components that are shipped with
Delphi that isn't descriped in the InterBase 6 API guide. Is this because
they isn't supported or just because they isn't documented?
Some database parameters are mentioned in the API guide but not descriped.
For example for how do I use the constants isc_dpb_license,
isc_dpb_encrypt_key, and isc_dpb_sql_role_name?
Is there any other place where these constants are descriped in detail
(apart from the source code for FB)?
-
SMN
> -----Original Message-----
> From: Alexandre Benson Smith [mailto:iblist@...]
> Sent: 6. april 2004 18:01
> To: firebird-support@yahoogroups.com
> Subject: Re: [firebird-support] Query optimisation
>
>
> At 10:01 06/04/2004 +0000, you wrote:
>
> >Hi all.
> >It is possible to make this query fully optimizable?
> >
> >select * from catalog_produse where cod_producator in
> >(select cod_producator from catalog_produse where cod_original like
> >?parameter)
> >
> >The PLAN is
> >PLAN (CATALOG_PRODUSE INDEX (CATALOG_PRODUSE_IDX3))
> >PLAN (CATALOG_PRODUSE NATURAL)
> >
> >Indexes:
> >CATALOG_PRODUSE_IDX2 on cod_original
> >CATALOG_PRODUSE_IDX3 on cod_producator
> >
> >The query is slow on a 50000 rows table, because, I think, the index
> >on cod_original is not used.
> >Only few rows are returned (average 5 rows)
> >
> >Thanks in advance
> >
>
> Hi Dorin,
>
> The "problem" in your query is the following part:
> where cod_original like ?parameter
>
>
> In a prepared query with like the optimizer could not use an
> index for this
> fields since he is unable to know if the parameter will contain:
> "ABC%"
> "AB%C"
> "%ABC%"
>
> the first two could use an index in a non prepared query, the last one
> could not use and index.
>
> if what you want is search by the start of the field, change that part to:
>
> where cod_original starts with ?parameter
>
> this will make the query use the index.
>
> HTH
>
>
> Alexandre Benson Smith
> Development
> THOR Software e Comercial Ltda.
> Santo Andre - Sao Paulo - Brazil
> www.thorsoftware.com.br
>
> ----------
>
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.631 / Virus Database: 404 - Release Date: 17/03/2004
>
>
> [Non-text portions of this message have been removed]
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>