create table objects
(
	object_id number(20),  -- BIND_AS(DB::BindableNetworkId)
	x float,
	y float,
	z float,
	quaternion_w float,
	quaternion_x float,
	quaternion_y float,
	quaternion_z float,
	node_x int,
	node_y int,
	node_z int,
	type_id int,
	scene_id varchar(50),
	controller_type int,
	deleted int,
	object_name varchar(127),
	volume int,
	contained_by number(20), -- BIND_AS(DB::BindableNetworkId)
	slot_arrangement int,
	player_controlled char(1),
	cache_version int,
	load_contents char(1),
	cash_balance int,
	bank_balance int,
	complexity float,
	name_string_table varchar2(500),
	name_string_text varchar2(500),
	object_template_id int,
	static_item_name varchar2(128),
	static_item_version int,
	conversion_id int,
	deleted_date date, -- NO_BIND
	load_with number(20), -- BIND_AS(DB::BindableNetworkId)
	objvar_0_name varchar2(50),
	objvar_0_type int,
	objvar_0_value varchar2(50),
	objvar_1_name varchar2(50),
	objvar_1_type int,
	objvar_1_value varchar2(50),
	objvar_2_name varchar2(50),
	objvar_2_type int,
	objvar_2_value varchar2(50),
	objvar_3_name varchar2(50),
	objvar_3_type int,
	objvar_3_value varchar2(50),
	objvar_4_name varchar2(50),
	objvar_4_type int,
	objvar_4_value varchar2(50),
	objvar_5_name varchar2(50),
	objvar_5_type int,
	objvar_5_value varchar2(50),
	objvar_6_name varchar2(50),
	objvar_6_type int,
	objvar_6_value varchar2(50),
	objvar_7_name varchar2(50),
	objvar_7_type int,
	objvar_7_value varchar2(50),
	objvar_8_name varchar2(50),
	objvar_8_type int,
	objvar_8_value varchar2(50),
	objvar_9_name varchar2(50),
	objvar_9_type int,
	objvar_9_value varchar2(50),
	objvar_10_name varchar2(50),
	objvar_10_type int,
	objvar_10_value varchar2(50),
	objvar_11_name varchar2(50),
	objvar_11_type int,
	objvar_11_value varchar2(50),
	objvar_12_name varchar2(50),
	objvar_12_type int,
	objvar_12_value varchar2(50),
	objvar_13_name varchar2(50),
	objvar_13_type int,
	objvar_13_value varchar2(50),
	objvar_14_name varchar2(50),
	objvar_14_type int,
	objvar_14_value varchar2(50),
	objvar_15_name varchar2(50),
	objvar_15_type int,
	objvar_15_value varchar2(50),
	objvar_16_name varchar2(50),
	objvar_16_type int,
	objvar_16_value varchar2(50),
	objvar_17_name varchar2(50),
	objvar_17_type int,
	objvar_17_value varchar2(50),
	objvar_18_name varchar2(50),
	objvar_18_type int,
	objvar_18_value varchar2(50),
	objvar_19_name varchar2(50),
	objvar_19_type int,
	objvar_19_value varchar2(50),
	script_list varchar2(2000),
	constraint pk_objects primary key (object_id) 
);

--create index objects_node_contained_by_idx on objects(node_x, node_z, contained_by, deleted);
create index chunk_idx on objects (node_x, node_z, scene_id, deleted, contained_by, player_controlled, load_contents);
create index deleted_object_idx on objects (deleted_date);
create index load_with_idx on objects (load_with);
create index container_idx on objects (contained_by);

grant select on objects to public;
