定义没有数据的表的大小(Oracle)

时间:2022-09-15 17:58:18

My problem is a little bit complicated, so please bear with me when I try to explain it ^_^.

我的问题有点复杂,所以当我试着解释它时,请耐心等待^ _ ^。

I work on automatically generating several (a big number) DW snowFlake schemas, from a star schema input. In the other hand, i have a set of queries, that change according to the schema of course.

我从星型模式输入中自动生成几个(大量)DW snowFlake模式。另一方面,我有一组查询,根据当然的模式进行更改。

My purpose is to calculate the cost model of each query on each schema, knowing that I have only statistics about table sizes, row sizes, page sytem sizes, etc (all the parameters needed to calculate the cost model). if there would be data, I could use the "explan plan of the dbms" to generate the "best" plan of each query in order to calculate the cost model, and this will save me a lot of time :)

我的目的是计算每个模式的每个查询的成本模型,知道我只有关于表大小,行大小,页面系统大小等的统计信息(计算成本模型所需的所有参数)。如果有数据,我可以使用“dbms的解释计划”生成每个查询的“最佳”计划,以便计算成本模型,这将节省我很多时间:)

But unfortunately, I have no data, and I wonder if I could use the "explain plan", just by setting the parameters without data, in other words, defining size of tables without data. Is it possible on Oracle, or any other DBMS??

但不幸的是,我没有数据,我想知道我是否可以使用“解释计划”,只需设置没有数据的参数,换句话说,定义没有数据的表的大小。是否可以在Oracle或任何其他DBMS上使用?

Thanks in advance.

提前致谢。

P.S : i could just ask the question : "Can i set the size of tables in oracle (or any other DBMS) (without having data), but i prefered to explain the whole problem, hoping that i'll have alternative proposals.

P.S:我可以问一下这个问题:“我可以在oracle(或任何其他DBMS)中设置表格的大小(没有数据),但我更愿意解释整个问题,希望我能有其他建议。

1 个解决方案

#1


2  

You can set the statistics on tables even if they have no data - then the CBO will use your statistics when generating execution plans.

即使表没有数据,您也可以设置表的统计信息 - 然后CBO将在生成执行计划时使用您的统计信息。

http://docs.oracle.com/cd/E11882_01/server.112/e16638/stats.htm#i41857

http://docs.oracle.com/cd/E11882_01/server.112/e16638/stats.htm#i41857

Just be aware of dynamic sampling (i.e. probably need to turn it off).

请注意动态采样(即可能需要将其关闭)。

#1


2  

You can set the statistics on tables even if they have no data - then the CBO will use your statistics when generating execution plans.

即使表没有数据,您也可以设置表的统计信息 - 然后CBO将在生成执行计划时使用您的统计信息。

http://docs.oracle.com/cd/E11882_01/server.112/e16638/stats.htm#i41857

http://docs.oracle.com/cd/E11882_01/server.112/e16638/stats.htm#i41857

Just be aware of dynamic sampling (i.e. probably need to turn it off).

请注意动态采样(即可能需要将其关闭)。