之前做聯合查詢很慢也很麻煩;需要對web_video表跟webvideo _day視圖做聯合查詢,但是速度奇慢
select a.* from web_video a webvideo b where a.id=b.id and a.site_id=?
換成這種方式之后就快多了
select a.* from web_video a where a.site_id=? and a.video_day=to_number(to_char(sysdate, 'yyyymmdd'));
video_day是一個物化視圖 MATERIALIZED VIEW——可以大大提高數據庫查詢的速度。
select a.* from web_video a webvideo b where a.id=b.id and a.site_id=?
換成這種方式之后就快多了
select a.* from web_video a where a.site_id=? and a.video_day=to_number(to_char(sysdate, 'yyyymmdd'));
video_day是一個物化視圖 MATERIALIZED VIEW——可以大大提高數據庫查詢的速度。