Drop Table

Support Forum for database administrators and web based access to important newsgroups related to databases
Register on Database Support Forum Edit your profileCalendarFind other Database Support forum membersFrequently Asked QuestionsSearch this forum -> 
For Database admins: Free Database-related Magazines Now Free shipping to Texas


Post New Thread










Thread
Author

ORDER BY is very slow when querying linked Server Oracle9i
I am creating 3 views from the linked server
and then I have a question at the bottom returning results.
If I exclude the ORDER BY from my question the query will take about 40
seconds,
with the ORDER BY it takes about an hour to finish.

Is this normal ??

code below
------------

create view xxxyyy1 as
SELECT INSATSID, STATUS
FROM HACTAR..EKOP2.INSATS

go

create view xxxyyy2 as
SELECT distinct insats, status  FROM HACTAR..EKOP2.RVAINK001905

go

create view xxxyyy3 as
select a.insatsid, a.status, b.insats AS 'INK905_INSATS', b.status AS
'INK905_STATUS'
from xxxyyy1 A left outer join xxxyyy2 B
on a.insatsid = b.insats
where  a.status <> b.status
go

SELECT
A.INSATSID,
A.STATUS_OLD,
A.STATUS_NEW,
A.ANDR_DATUM,
A.ANDR_TID,
B.INSATSID,
B.STATUS,
B.INK905_INSATS,
B.INK905_STATUS
FROM HACTAR..EKOP2.INSATSLOG A
right outer join xxxyyy3 B
on A.INSATSID = B.INSATSID
WHERE A.ANDR_DATUM < 20060225
ORDER BY
A.INSATSID,
A.ANDR_DATUM,
A.ANDR_TID,
A.STATUS_OLD,
A.STATUS_NEW


Report this thread to moderator Post Follow-up to this message
Old Post
ln54
03-01-06 01:23 AM


Re: ORDER BY is very slow when querying linked Server Oracle9i
Hi
See an execution plan. My guess in order to increase performance you may
want  to add an index on the column in ORDER BY clause






"ln54" <ln54@discussions.microsoft.com> wrote in message
news:7B8F4D82-6F9B-423A-A3A4- EC957A72A876@microso
ft.com...
>I am creating 3 views from the linked server
> and then I have a question at the bottom returning results.
> If I exclude the ORDER BY from my question the query will take about 40
> seconds,
> with the ORDER BY it takes about an hour to finish.
>
> Is this normal ??
>
> code below
> ------------
>
> create view xxxyyy1 as
> SELECT INSATSID, STATUS
> FROM HACTAR..EKOP2.INSATS
>
> go
>
> create view xxxyyy2 as
> SELECT distinct insats, status  FROM HACTAR..EKOP2.RVAINK001905
>
> go
>
> create view xxxyyy3 as
> select a.insatsid, a.status, b.insats AS 'INK905_INSATS', b.status AS
> 'INK905_STATUS'
> from xxxyyy1 A left outer join xxxyyy2 B
> on a.insatsid = b.insats
> where  a.status <> b.status
> go
>
> SELECT
> A.INSATSID,
> A.STATUS_OLD,
> A.STATUS_NEW,
> A.ANDR_DATUM,
> A.ANDR_TID,
> B.INSATSID,
> B.STATUS,
> B.INK905_INSATS,
> B.INK905_STATUS
> FROM HACTAR..EKOP2.INSATSLOG A
> right outer join xxxyyy3 B
> on A.INSATSID = B.INSATSID
> WHERE A.ANDR_DATUM < 20060225
> ORDER BY
> A.INSATSID,
> A.ANDR_DATUM,
> A.ANDR_TID,
> A.STATUS_OLD,
> A.STATUS_NEW
>



Report this thread to moderator Post Follow-up to this message
Old Post
Uri Dimant
03-01-06 01:23 AM


Re: ORDER BY is very slow when querying linked Server Oracle9i
Thankyou, the ORDER BY statement causes it to do a lot of Nested loops
which seems to be very time consuming

"Uri Dimant" wrote:

> Hi
> See an execution plan. My guess in order to increase performance you may
> want  to add an index on the column in ORDER BY clause
>
>
>
>
>
>
> "ln54" <ln54@discussions.microsoft.com> wrote in message
> news:7B8F4D82-6F9B-423A-A3A4- EC957A72A876@microso
ft.com... 
>
>
>

Report this thread to moderator Post Follow-up to this message
Old Post
ln54
03-01-06 01:23 AM


Sponsored Links





Last Thread Next Thread
Post New Thread

MS SQL Server archive

Show a Printable Version Email This Page to Someone! Receive updates to this thread
Microsoft SQL Server
Access database support
PostgreSQL Replication
SQL Server ODBC
FoxPro Support
PostgreSQL pgAdmin
SQL Server Clustering
MySQL ODBC
Web Applications with dBASE
SQL Server CE
MySQL++
Sybase Database Support
MS SQL Full Text Search
PostgreSQL Administration
SQL Anywhere support
DB2 UDB Database
Paradox Database Support
Filemaker Database
Berkley DB
SQL 2000/2000i database
ASE Database
Forum Jump:
All times are GMT. The time now is 09:33 AM.

 
Mobile devices forum | Database support forum archive




Copyrights DropTable.com Database Support Forum 2004 - 2006