Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8165633
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T19:35:51+00:00 2026-06-06T19:35:51+00:00

I have some timeout problems when executing a SELECT query. It is SQL Server

  • 0

I have some timeout problems when executing a SELECT query.

It is SQL Server 2008 linked to an Oracle server (database AAAA, tables K and P).
The provider we are using is Microsoft OLE DB Provider for Oracle (MSDAORA).

SELECT     
    I.DOF AS Id, I.DokumentDatumDokumenta, I.DokumentaDatumPrejetja, 
    I.PartnerID, I.PartnerNaziv, I.PartnerNaslov, I.PartnerIdentifikacijskaStevilka, 
    I.PartnerPostnaStevilka, I.PartnerKraj, I.PartnerDrzava,   
    I.PrejemnikInternoPodjetjeId, I.PrejemnikInternoPodjetje,   
    I.PrejemnikOrganizacijskaSkupinaId, 
    I.PrejemnikOrganizacijskaSkupina, I.PrejemnikZaposleni, I.DokumentEksternaOznaka, 
    I.DokumentVrstaDokumenta, I.DokumentZadeva, 
    I.ProcesOpravilo, I.PrejemnikVSkupiniId, I.PrejemnikVSkupiniNaziv, 
    I.PrejmnikVSkupiniWorkflowId, D.Path AS EDokumentPath, I.SkeniranjeUporabnik, 
    I.SkeniranjeTime, I.ReleaseTime, I.WorkflowName, I.NadzornikRacunaId, 
    I.NadzornikRacunaNaziv, I.NadzornikRacunaWorkflowId, I.Znesek, 
    K.SIF_VAL AS Valuta, D.ZagnanProcesTime, I.DatumValute, I.StevilkaNarocila, 
    I.DUR, D.DocId, P.ZNESEK AS ZnesekVeur
FROM         
    dbo.tblAscentIndex AS I 
INNER JOIN
    dbo.tblAscentDoc AS D ON D.DocId = I.DocId 
INNER JOIN
    dbo.AAAA_tblPosiljke AS K ON I.DOF = K.DOF 
INNER JOIN
    OPENQUERY(AAAA, 'SELECT DOF,ZNESEK FROM KDF_INPUT_POD') AS P ON P.DOF = I.DOF

If anyone has any optimization proposal for this query I would be very grateful.

The problem lies because it is fetching data from both local SQL Server and linked Oracle, but perhaps some query optimization might fix the problem.

Regards.

UPDATE:

The indexes are set OK and the amount of data in the tables is less then 100k.
I have traced the problem to dbo.AAAA_tblPosiljke that is a view on MSSQL server that is fetching data from table on Oracle. Here is the query:

SELECT     ID_KIP AS ID_CDS, STATUS, DOF, ST_DOK AS ST_DOKUMENTA, SIF_OE, SIF_PP, IDENTIF_ST_OE, IDENTIF_ST_PP, DAT_DOSPETJA, DAT_DUR, 
                      SIF_VAL, ZNESEK_VAL, OPIS, VR_PREDMETA, PODPISNIK AS SIF_PODPISNIKA, REFERENT AS SIF_REFERENTA, DAT_FAKTURE, ST_NAROCILA, 
                      DAT_ZAPADLOSTI, APLIKACIJA, DAT_OBDOBJA, DAT_ECL, ST_ECL, CAR_POSTOPEK, MODEL, SKLIC, VRSTA_TRR, VEZA_URL, 
                      KPA_STATUS_PRENOSA, KPA_NAPAKA, UPORABNIK, ID_ARH, VK_PGD, ID_PGD, PROJEKT
FROM         OPENQUERY(AAAA, 'SELECT * FROM KDF_INPUT_POD WHERE STATUS NOT IN (9)') AS derivedtbl_1
WHERE     (DAT_DOSPETJA > CONVERT(DATETIME, '2012-03-01 00:00:00', 102))

The portion of this query takes over 2 minutes to execute while on Oracle same query takes less then a second. Looks like a problem with fetching data. Any idea how to aproach the optimisation?

Regards.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T19:35:53+00:00Added an answer on June 6, 2026 at 7:35 pm

    I resolved the issue by creating the problematic tables localy. I am syncing the tables periodically and am executing them on sql sever side rather then on oracle side.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have some problems with a Query seem IN dosen't work with Group_concat, that
I have some tables roughly like so: Client: id name Employee id name Email
I use Backbone.js and jQuery 1.7 in my application and I have some problems
the following script testssh.ksh proves that ssh have some problems when we try to
We have an Access database migrated from Access 97 to Acces 2007 with some
I have some database table and need to process records from it 5 at
I have been having some problems with the test debugger in VS10. All tests
I have 2 tables in a query designed to display/email the saved search info
I have some data loaded as a np.ndarray and need to convert it to
I have some arbitrary pixel data that I want to save as a PNG.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.