Pergunta

Suppose I have a table having a thousand or more users. If I create a view for each user does it affect performance?

CREATE VIEW vw_userid of user AS
SELECT * 
FROM Updates 
WHERE userid='userid of user'
Foi útil?

Solução

I think in your case it is effecting, coz first query will read a table & generate view, Again it will do read operation to Retrieve data, Also you are creating view in run time so every time it will consume memory.If I/O request will be more then your server may become unresponsive. i will suggest to go with Select statement will be better for you.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top