Subject | Re: Bug in Firebird 2 with IN clause statement |
---|---|
Author | zlatko.ivankovic |
Post date | 2008-03-03T20:53:16Z |
--- In firebird-support@yahoogroups.com, "roecki" <roecki@...> wrote:
statement retreive to two statements.
First Statement would be to get all ShippingAddressID's from apOrder
Second Statement would be to get all Addresses for set of
ShippingAddressID's from first step. I think it would run faster.
Regards,
Zlatko
>vendor
> Thanks Zlatko!
>
> This query runs very fast! Thanks!
>
> The only problem is that the query is generated by an OR-Mapper. I
> have forwarded this to the vendor of the OR-Mapper. I hope the
> will change this.Don't know which OR mapper you use, but you can try to break one
statement retreive to two statements.
First Statement would be to get all ShippingAddressID's from apOrder
Second Statement would be to get all Addresses for set of
ShippingAddressID's from first step. I think it would run faster.
Regards,
Zlatko
> > >247,
> > > SELECT "address".ID,
> > > "address"."EnvironmentID",
> > > "address"."eBayUserDBID" AS "EBayUserDBID",
> > > "address"."SiteID",
> > > "address"."Name",
> > > "address"."Company",
> > > "address"."Phone",
> > > "address"."Street1",
> > > "address"."Street2",
> > > "address"."CityName",
> > > "address"."StateOrProvince",
> > > "address"."Country" AS "CountryBasevalue",
> > > "address"."CountryName",
> > > "address"."PostalCode",
> > > "address"."AddressID",
> > > "address"."ExternalAddressID",
> > > "address"."AddressOwner" AS "AddressOwnerBasevalue",
> > > "address"."AddressStatus" AS "AddressStatusBasevalue",
> > > "address"."IntlName",
> > > "address"."IntlStateAndCity",
> > > "address"."IntlStreet",
> > > "address"."ts" AS "Ts",
> > > "address"."Salutation",
> > > "address"."Firstname"
> > > FROM "address"
> > > WHERE
> > > ("address".ID IN (
> > > SELECT "apOrders"."ShippingAddressID"
> > > FROM "apOrders"
> > > WHERE
> > > ("apOrders".ID IN (243, 244, 245, 246,
> > 248,186,
> > > 175, 176,
> > > 177, 178, 179, 180, 181, 182, 183, 184,
> > 187,198,
> > > 188, 189,
> > > 190, 191, 192, 193, 194, 195, 196, 197,
> > 199,210,
> > > 200, 201,
> > > 202, 203, 204, 205, 206, 207, 208, 209,
> > 211,
> > > 212, 213,
> > > 215, 216, 217, 218, 219, 220))
> > > ))
> > >
> > >
> >