Subject | Re: [firebird-support] indexing a status column |
---|---|
Author | Milan Babuskov |
Post date | 2004-07-26T20:29:56Z |
sugi wrote:
it all together when needed:
create view current_name_of_your_table (col1, col2, col3, status)
as
select col1, col2, col3, 1 from table1
union all
select col1, col2, col3, 2 from table2
union all
select col1, col2, col3, 3 from table3
union all
select col1, col2, col3, 4 from table4
union all
select col1, col2, col3, 5 from table5;
So you can still use it the way you use it now, and you have much faster
queries when only one is needed.
HTH
--
Milan Babuskov
http://fbexport.sourceforge.net
> Will it be a good idea to either :No.
> a. create an index on the 'status' column ?
> c. split the table into five different tables with identical structure,Good idea. You can use a view (named as your table is named now) to get
> and remove the 'status' column altogether ? (I don't like the idea at
> all, but someone suggested this, so i'll ask for second opinions).
it all together when needed:
create view current_name_of_your_table (col1, col2, col3, status)
as
select col1, col2, col3, 1 from table1
union all
select col1, col2, col3, 2 from table2
union all
select col1, col2, col3, 3 from table3
union all
select col1, col2, col3, 4 from table4
union all
select col1, col2, col3, 5 from table5;
So you can still use it the way you use it now, and you have much faster
queries when only one is needed.
HTH
--
Milan Babuskov
http://fbexport.sourceforge.net