Vimal Kumar
Vimal Kumar

Reputation: 21

What is the difference between views and temporary tables in mysql? which is better?

What is the difference between views and temporary tables in mysql? which is better?

Upvotes: 0

Views: 2737

Answers (1)

Susarla Nikhilesh
Susarla Nikhilesh

Reputation: 178

Performance between Views and Temporary table is straight forward.

They depend on their definitions :

Temporary tables are just the tables in tempdb. Views are stored queries for existing data in existing tables.

Temporary table needs to be populated first with data, and population is the main preformance-concerned issue.

So the data in views already exists and so views are faster than temporary table.

If any issue or query please let me know.

Upvotes: 3

Related Questions