我有以下create語句:一個大表或歸兩個表中插入選擇性能
CREATE TABLE venues
(
id integer NOT NULL,
fs_id varchar,
name varchar,
phone varchar,
address varchar,
latitude double precision,
longitude double precision,
city varchar,
state varchar,
country varchar,
category_fs_id varchar,
category_name varchar,
CONSTRAINT pk_venue_id PRIMARY KEY (id)
);
我能得到我想要一個查詢,但實在是太多了列,所以我可以創造一個更表所示:
CREATE TABLE venues
(
id integer NOT NULL,
fs_id varchar,
name varchar,
category_fs_id varchar,
category_name varchar,
venue_info_id integer,
CONSTRAINT pk_venue_id PRIMARY KEY (id)
CONSTRAINT fk_venue_info_id FOREIGN KEY (venue_info_id)
REFERENCES venue_info (id) MATCH SIMPLE
ON UPDATE NO ACTION ON DELETE NO ACTION
);
CREATE TABLE venue_info
(
phone varchar,
address varchar,
latitude double precision,
longitude double precision,
city varchar,
state varchar,
country varchar,
);
但畢竟這我應該寫爲每個插入兩個查詢,並連接表中選擇查詢 是它降低性能或我可以,即使在這種情況下,一個查詢做呢?
「太多列」是什麼? –