Tag Info

New answers tagged

4

The difference between global and local temp tables isn't how long they exist, it's who can see them. Local temp tables can only be seen by the session (spid) that created them. Global temp tables can be seen by everyone, but only while the session that created them is active. If you are running it in a SQL Agent job, as soon as it completes it ...


0

Well, it depends on the application but, yes you will have retrieved the records and presented them. If you don't need to access the temporary table again you can drop it.


3

If the table has an index, you may want to consider the cluster command instead of re-creating it or using vacuum full. This will: Have the same effect on dead tuples - it physically re-writes the whole table Retains any existing indexes Might improve performance more than just removing dead tuples, depending on whether you will benefit from the clustering ...


1

It achieves the same effect as a VACUUM FULL except that it can be executed within a transaction block. Of course, any indices or constraints on the original table would be lost in the given example. I would need to know some additional information to help explain the performance increase: Are there any indices or constraints on the original table? Is ...



Top 50 recent answers are included