本文整理汇总了C#中CUBRID.Data.CUBRIDClient.CUBRIDConnection.GetQueryPlanOnly方法的典型用法代码示例。如果您正苦于以下问题:C# CUBRIDConnection.GetQueryPlanOnly方法的具体用法?C# CUBRIDConnection.GetQueryPlanOnly怎么用?C# CUBRIDConnection.GetQueryPlanOnly使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CUBRID.Data.CUBRIDClient.CUBRIDConnection
的用法示例。
在下文中一共展示了CUBRIDConnection.GetQueryPlanOnly方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: QueryPlanOnly_Test
public void QueryPlanOnly_Test()
{
using (CUBRIDConnection conn = new CUBRIDConnection())
{
LogTestStep("Test GetQueryPlanOnly");
conn.ConnectionString = DBHelper.connString;
conn.Open();
string queryPlan = conn.GetQueryPlanOnly("select * from athlete order by 1 desc");
//the string I get from Linux does not cotain tab and enter
Console.WriteLine(queryPlan);
Assert.IsTrue(queryPlan.Contains("Join graph segments (f indicates final):"));
Assert.IsTrue(queryPlan.Contains("class: athlete node[0]"));
Assert.IsTrue(queryPlan.Contains("select athlete.code, athlete.[name], athlete.gender, athlete.nation_code, athlete.event from athlete athlete order by 1 desc"));
LogStepPass();
LogTestResult();
}
}
示例2: Test_QueryPlanOnly
/// <summary>
/// Test CUBRIDConnection GetQueryPlanOnly() method
/// </summary>
private static void Test_QueryPlanOnly()
{
using (CUBRIDConnection conn = new CUBRIDConnection())
{
conn.ConnectionString = TestCases.connString;
conn.Open();
string queryPlan = conn.GetQueryPlanOnly("select * from athlete order by 1 desc");
Debug.Assert(queryPlan == "Join graph segments (f indicates final):\nseg[0]: [0]\nseg[1]: code[0] (f)\nseg[2]: name[0] (f)\nseg[3]: gender[0] (f)\nseg[4]: nation_code[0] (f)\nseg[5]: event[0] (f)\nJoin graph nodes:\nnode[0]: athlete athlete(6677/27) (sargs 0)\nJoin graph terms:\nterm[0]: athlete.code range (-2147483648 ge_inf max) (sel 1) (rank 2) (sarg term) (not-join eligible) (indexable code[0]) (loc 0)\n\nQuery plan:\n\niscan\n class: athlete node[0]\n index: pk_athlete_code term[0] (desc_index)\n sort: 1 asc\n cost: 92 card 6677\n\nQuery stmt:\n\nselect athlete.code, athlete.[name], athlete.gender, athlete.nation_code, athlete.event from athlete athlete where (athlete.code>=-2147483648) order by 1 desc \n\n/* ---> skip ORDER BY */\n");
}
}