Subject | Re: 20 minute query in v 2.0 and 2.1 |
---|---|
Author | callmefreud2 |
Post date | 2007-07-02T17:52:46Z |
The way we solved this was by not using a select statement after
the "IN". Using EXISTS instead of IN (Select...) significantly
speeds up all such queries.
thx for the input
the "IN". Using EXISTS instead of IN (Select...) significantly
speeds up all such queries.
thx for the input
--- In firebird-support@yahoogroups.com, "Adam" <s3057043@...> wrote:
>
> --- In firebird-support@yahoogroups.com, "callmefreud2" <rikki@>
wrote:
> >
> > We have a query that is fast in the FB 2.0 RC version, but in
2.0 and
> > 2.1 takes 20 minutes. Essentially it deletes all records from a
table
> > in a master detail relationship.
> > something like delete from detailTable where not exists (select
distict
> > masterTable.ID from masterTable where mastertableID =
detailTable.FK)
> >
> > Does anyone know what might have changed significantly after
that RC
> > version? And will it / can it be fixed.
>
> Should you not have a foreign key constraint on these fields? If
you
> did, it would be impossible for any such records to exist.
>
> Adam
>