Giter VIP home page Giter VIP logo

Comments (3)

Alex-Monahan avatar Alex-Monahan commented on August 15, 2024 1

Good questions! Here are a few answers and we can add more details to the docs as well.

The tables reside in memory, but I am not certain what happens if they exceed memory (@Mytherin
or @hannes happen to know?) . I believe that they would use a temporary file if they exceeded memory?

Temporary tables last for the duration of your connection to DuckDB, so they are removed when you disconnect.

There are a number of use cases, as they are present in many databases. It can be useful to materialize an intermediate computation temporarily for many reasons (maybe you want to reuse that result set multiple times within that connection like in your case, or index it before you join on it, or just simplify your query by splitting it into pieces). Does that help? I think they are a good fit for your use case!

from duckdb-web.

Mytherin avatar Mytherin commented on August 15, 2024 1

The tables reside in memory, but I am not certain what happens if they exceed memory (@Mytherin or @hannes happen to know?) . I believe that they would use a temporary file if they exceeded memory?

If a temp_directory is specified chunks of the temporary table can indeed be off-loaded to disk as required. If not then an error will be thrown.

from duckdb-web.

hawkfish avatar hawkfish commented on August 15, 2024 1

There are basically two styles of "temporary tables" out there: global and session scoped.

Global tables are permanent tables that have a globally defined schema, but the data is private to the session (e.g., Oracle). One nasty problem with them is that you can't use them for the kind of local analytics you are describing because the temporary table name is global. This is problematic for query generating systems (like Tableau, which is where I ran into this).

Fortunately, as a single user system, DuckDB supports session scoped temporary tables. Using them to cache expensive intermediate results such as rollups is a common use case, so go for it!

from duckdb-web.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.