Thread: exclusive access

exclusive access

From
Miso Hlavac
Date:
Hi,

I develop web application. My case model consists of many tables. I
have VIEW through the 5 tables and 4 JOINs.

first table has 14000 rows, second 42000 rows and others have around
20 rows.

Time of query depends on WHERE condition.
SELECT COUNT(*) FROM v_auto_detail_seller; takes time 1 sec.
SELECT i_auto_id, v_name, f_price, i_year FROM v_auto_detail_seller; takes time 2 sec.

but this time is not good for me. I need time max. around 0,2 sec.
I must do this:

SELECT * INTO t_auto FROM from v_auto_detail_seller;

then queries on t_auto are very fast; But I must provide
reference integrity by triggers.
sometimes I need lock entire database for access, because this:
BEGIN WORK;
DROP t_auto;
SELECT * INTO t_auto FROM from v_auto_detail_seller;
COMMIT WORK;

May I provide exlusive access to database??? Or exists some other
solutions for my problem??? :)

sorry for english... thanx, miso