Skip to Main Content
  • Questions
  • Temporary Groups vs. Really large temporary tablespace

Breadcrumb

Question and Answer

Connor McDonald

Thanks for the question.

Asked: April 02, 2016 - 5:36 pm UTC

Last updated: August 25, 2023 - 4:52 am UTC

Version: 11.2

Viewed 1000+ times

You Asked

Hello Gentlemen,

I am trying to understand why Oracle came up with the "temporary tablespace group" concept. the documentation claims that it is used to allow large temporary space operations from running out of space. My question is, why not just increase the size of the old fashion temporary tablespace to be the same size of whatever the sum of the temporary tablespace group is?

Thanks,

john

and Connor said...

There's some history and perhaps a niche usage.

Up until (I think) 11.2, if a single temp tablespace had (say) 8 tempfiles, then we didnt randomly pick files to allocate space in for sorting etc, we used the first one, and then when that was full, the second one etc...

Hence we could get contention for those "early" files. You could then have multiple tablespaces, but then you had to manually spread schemas out across them etc...Hence tablespace groups to solve that issue.

Another possibility comes with the advent of bigfile tablespaces, where there is only one file per tablespace. Some OS's dont like heavily concurrent access to a single file, so tablespace groups can be of assistance there.

In particular, think of heavily parallel queries which might "all of a sudden" have 20 or 30 or 60 sessions all asking for temp space at the "same" time.

Hope this helps.

Rating

  (2 ratings)

Is this answer out of date? If it is, please let us know via a Comment

Comments

John Cantu, April 03, 2016 - 3:30 pm UTC

Wow, Connor. i am really shocked to hear about that Oracle didn't have the logic in there to provide more of a load balance between files. I have often wondered if there would be a negative change in performance or other negative issue between a tablespace that had one data file or one that had multiple within the same set of disks when I thought about adding an additional data file to our production system to avoid running out of space. I resisted because if something went haywire, I wouldn't know what to tell them regarding the "innocent" change that Oracle training tells us we can't make. I suppose I can run that test. What are your thoughts? do you think that there will be quirks between using one data file sized at 20 gB or two data files each sized at 10 gB on a regular tablespace?

I wish you taught Oracle training and would bring up all of these quirks. I feel like a doctor from the 15th century performing operations just like I was taught. then, having half of my patients die because of operation induced infections caused by lack of hygiene, which at the time wasn't known to be necessary since bacteria hadn't been discovered yet. However, Oracle knows bacteria exists so they should mention it to us in training.
Connor McDonald
April 04, 2016 - 1:08 am UTC

"Oracle didn't have the logic in there to provide more of a load balance between files"

Well we do now :-) That's just how things are with any software... you build something, find a gap, fill it, make it better, etc. In you're on 11.2 onwards, which hopefully most people are, then you'd never know it was *not* there in the past. And dont forget, we are talking tempfiles here. Permanent tablespaces have (for as long as I can remember) allocated extents across *all* the datafiles in the tablespace.

And in reality, besides the potential issue of file level locking (which is an OS layer dependency), the concept of "which" file to use gets less all the time, as the number of abstractions between database and disk increases. Nowdays, its almost impossible to know *which* disk(s) a file resides on (if on a disk at all) with all the smarts inside storage controllers/arrays etc.

(Thanks for the feedback)

Any reason to use temporary tablespace groups on Oracle 19/21c+?

blaisem, August 17, 2023 - 12:06 am UTC

Well we do now

Does this mean there is practically no reason to use temporary tablespace groups in Oracle 19/21c?

I know in your OP you mentioned OS issues with concurrent access to single files. Given this comment was in 2016, do modern OS's, or in particular any recent Oracle Linux version, have diminished performance with concurrent access to single files, that would warrant considering a temporary tablespace group under large enough data volumes / DML operations?

Just trying to get a feel if this feature should be on my radar for performance improvements, or if it's effectively become obsolete over time.
Connor McDonald
August 25, 2023 - 4:52 am UTC

I've almost never seen a temp tspace group "in the wild" so I dont think there is a massive need for them.

There's possibly an argument for massively parallel queries, namely, allowing each parallel query thread to get access to their "own" temp tspaces within a group.

But definitely (imo) this is a niche feature

Others welcomed to add their experiences.