2017-01-25 1 views
1

私はこのクエリ使用しています:Inanticクエリツールで正確なオンラインクエリを使用するとタイムアウトエラーが発生しましたか?

select * 
from MailMessagesReceived mmd 
inner 
join MailMessageAttachments mmt 
on  mmd.ID = mmt.ID 
Where mmd.created > '2017-01-01' 
And mmd.SenderMailbox = '[email protected]' 
And mmd.RecipientStatusDescription = 'Prepared' 

を、私はメッセージコードなしで誤りを時間を出します。それは読んで、 "あなたは愛のために時間切れになっています。"次の詳細は、エラーに添付されている:私は「スキャンエンHerken」(すなわち、スキャンや請求書の認識)正確なオンラインでの受信トレイの概要を取得しようとしている

select * from MailMessagesReceived 
inner join MailMessageAttachments 
on MailMessagesReceived.ID = MailMessageAttachments.ID 
Where MailMessagesReceived.created > "2017-01-01" 
And MailMessagesReceived.SenderMailbox = "finappan[email protected]" 
And MailMessagesReceived.RecipientStatusDescription = "Prepared" 

Type: System.Net.WebException 
bij System.Net.HttpWebRequest.GetResponse() 
bij Invantive.Data.ODataProvider.DoRequest(HttpWebRequest request, String url, String partition, String& returnUrl, Dictionary`2& headers) in File161:regel 3666 
bij Invantive.Data.ODataProvider.GetInternal(String relativeUrl, String mimeType, String partition, Boolean allowFromCache, String& returnUrl, Dictionary`2& headers, Boolean& fromCache) in File161:regel 3001 
bij Invantive.Data.ODataProvider.Get[T](String relativeUrl, Dictionary`2& headers, String& fullUrl, Boolean& resultFromCache, String partition, Boolean allowFromCache, String mimeType) in File161:regel 2880 
bij Invantive.Data.ODataProvider.ReadDataFromServiceResponse(List`1 rows, String basePath, List`1 allFieldTypes, String url, String partition, ObjectDefinition objectDefinition, QueryObject queryObject, Int32& pagesRetrieved, Int32& rowsRetrieved) in File161:regel 1102 
bij Invantive.Data.ODataProvider.FetchDataOnePartition(String serviceUrl, String partition, List`1 rows, String basePath, List`1 allFieldTypes, ObjectDefinition objectDefinition, QueryObject queryObject, ParameterList parameters) in File161:regel 1021 
bij Invantive.Data.ODataProvider.<>c__DisplayClass72_3.<Fetch>b__2(String partition) in File161:regel 877 
--- Einde van stacktracering vanaf vorige locatie waar uitzondering is opgetreden --- 
bij Invantive.Data.ODataProvider.Fetch(EntityFieldCollection entityFields, QueryObject queryObject, ParameterList parameters, Boolean fetchSingle, Boolean fetchCountFirst, Int32 pagingSteps, Boolean fetchCount, ResultSet& resultSet, Int32& totalNumberOfRows) in File161:regel 914 
bij Invantive.Data.ExactOnlineProvider.Fetch(EntityFieldCollection entityFields, QueryObject queryObject, ParameterList parameters, Boolean fetchSingle, Boolean fetchCountFirst, Int32 pagingSteps, Boolean fetchCount, ResultSet& resultSet, Int32& totalNumberOfRows) in File298:regel 909 
bij Invantive.Data.ConnectionManager.ExecuteProviderFetch(EntityFieldCollection entityFields, QueryObject queryObject, ParameterList parameters, Boolean fetchSingle, Boolean fetchCountFirst, Int32 pagingSteps, Boolean fetchCount, Int32& totalNumberOfRows, String& handlingPath) in File39:regel 3190 
bij Invantive.Data.ConnectionManager.Fetch(EntityFieldCollection entityFields, QueryObject queryObject, ParameterList parameters, Boolean fetchSingle, Boolean fetchCountFirst, Int32 pagingSteps, Boolean fetchCount) in File39:regel 1406 
bij Invantive.Sql.DataSourceOrFunctionTree.<GetDataFromDataContainer>d__29.MoveNext() in File120:regel 315 
bij System.Collections.Generic.List`1..ctor(IEnumerable`1 collection) 
bij System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source) 
bij Invantive.Sql.FirehoseResultSet.<Iterator>d__54.MoveNext() in File133:regel 547 
bij System.Collections.Generic.List`1..ctor(IEnumerable`1 collection) 
bij System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source) 
bij Invantive.Sql.FirehoseResultSet.<Iterator>d__54.MoveNext() in File133:regel 559 
bij System.Linq.Buffer`1..ctor(IEnumerable`1 source) 
bij System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source) 
bij Invantive.Sql.JoinIterator.<JoinInternal>d__13.MoveNext() in File135:regel 481 
bij Invantive.Sql.FilterIterator.<Iterator>d__3.MoveNext() in File132:regel 92 
bij Invantive.Sql.ChainedFirehose.<Iterator>d__11.MoveNext() in File130:regel 81 
bij Invantive.Sql.SelectListIterator.<Iterator>d__7.MoveNext() in File138:regel 119 
bij System.Collections.Generic.List`1..ctor(IEnumerable`1 collection) 
bij System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source) 
bij Invantive.Sql.QueryPlan.Fetch() in File140:regel 91 
bij Invantive.Data.ConnectionManager.ExecuteProviderPassthroughSqlActionTable(String actionSql, ParameterList parameters, String& handlingPath) in File39:regel 4033 
--- Einde van stacktracering vanaf vorige locatie waar uitzondering is opgetreden --- 
bij System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() 
bij Invantive.Data.ConnectionManager.ExecuteProviderPassthroughSqlActionTable(String actionSql, ParameterList parameters, String& handlingPath) in File39:regel 4062 
bij Invantive.Data.ConnectionManager.PassthroughSqlActionTable(String actionSql, ParameterList parameters) in File39:regel 2086 
--- Einde van stacktracering vanaf vorige locatie waar uitzondering is opgetreden --- 
bij System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() 
bij Invantive.Data.ConnectionManager.PassthroughSqlActionTable(String actionSql, ParameterList parameters) in File39:regel 2098 
bij Invantive.Data.ActionProceduresBase.PassthroughSqlActionTable(String actionSql, ParameterList parameters) in File29:regel 134 
bij Invantive.Producer.Windows.Forms.QueryTool.ExecuteStatement(IProgressNotifier notifier, String statement, ParameterList bindVariables, Boolean showResultsInGrid, Boolean showStatistics, Boolean memorizeStatisticsInSqlHistory, Boolean allowPaging) in File948:regel 2847 
bij Invantive.Producer.Windows.Forms.QueryTool.FetchResultsFromSql() in File948:regel 2430 

。この受信トレイは、請求書が含まれており、コンピュータのいずれかであり、それぞれがアカウントエントリを、生成された:

  • (緑色)を処理する準備ができ、
  • は、いくつかの変化(黄色)を必要
  • 又はmannualy処理する必要があります(赤)。

これらの3つの異なる州のそれぞれにいくつの請求書があるか具体的に知りたいと思います。変更や手動修正が必要な方には、エラーの内容を知りたいと思っています。

私が使っていたクエリでは、MailMessageAttachmentsテーブルにどのデータが含まれているかを調べていました。私は正しい場所を掘っているのかどうか分からないので、その件に関するアドバイスはすばらしいものになるでしょう。さらに、なぜ私のSQLコードがタイムアウトになったのかを知りたい。

答えて

1

いくつかの改善点があります。 Exact OnlineのREST APIメール・メッセージ(JSON)は、最近、パフォーマンスが向上するように再構成されましたが、それでも最速のものではありません。

あなたが使用してインスタンスのために、操作したいだけの部門を選択し、そのすべての最初のを確認してください。代わりに使用しての

use 123456,345678,56789 

を:小さなとの

use all 

スタートいくつかのサンプルデータとの分割、およびクエリがより大きな部門でテストすることでパフォーマンスを向上させる場合に役立ちます。

また、あなたは何の暗黙的なデータ型変換が行われないことを確認するには、とても好むかもしれない:

date-field > to_date('20170101', 'yyyymmdd') 

date-field > '2017-01-01' 

にこのクエリでは、それはおそらく傷つけることはありません。

説明ではなくステータスコードを照会する方がよいでしょう。説明は国ごと、さらにはユーザーごとに異なります。コードは索引付けされていても、翻訳可能な記述は索引付けされていない可能性があります。

また、すべてのメールに添付ファイルがあるわけではないので、左外部結合を使用する方がよいでしょう。

また、MailMessageAttachmentsテーブルはHUGEテーブル(多くのドキュメントがバイナリ形式で含まれています。特に、グレースケールまたはカラースキャナを使用している場合が多くあります)。各行は複数のメガバイトをダウンロードできるので、絶対に必要なときにのみ参加するほうがよいでしょう。

最後に、 'top'または 'limit'構文を使用して限られた数の行が検索された後で、クエリの実行を停止することができます。

結果のクエリ:set requests-parallel-max 8を使用して30個の小区分で実行した場合、それは行に約1分かかります

select * 
from MailMessagesReceived mmd 
left 
outer 
join MailMessageAttachments mmt 
on  mmd.ID = mmt.ID 
Where mmd.created > to_date('20170101', 'yyyymmdd') 
And mmd.SenderMailbox = '[email protected]' --  '[email protected]' 
and mmd.recipientstatus = 20 /* Open. Etc, look up for Prepared. Enables index use. */ 
limit 50 

PS。 select * from exactonlinerest..sessioniosを使用して、実際のRESTおよびXML URL呼び出しとその期間を見つけることができます。

関連する問題