Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add a guide on materialized ctes to query-data #3499

Open
wants to merge 2 commits into
base: latest
Choose a base branch
from

Conversation

rdmolony
Copy link
Contributor

Description

I just found out about materialized CTEs and thought I really should share this for people in similar situations.

I'm consulting with a company that hides TimescaleDB behind a task queue, & some jobs were taking ages. Using with cache as materialized ( ... ) resulted in a query that was taking days now takes 30 seconds! These last few months I was getting frustrated that the Postgres query planner kept deciding on NestedLoop joins.

I see that you guys cover this in https://www.timescale.com/learn/how-to-use-common-table-expression-sql - however I reckon it could be covered in the query-data section of the docs too to force this on people?

Links

Fixes #[insert issue link, if any]

Writing help

For information about style and word usage, see the style guide

Review checklists

Reviewers: use this section to ensure you have checked everything before approving this PR:

Subject matter expert (SME) review checklist

  • Is the content technically accurate?
  • Is the content complete?
  • Is the content presented in a logical order?
  • Does the content use appropriate names for features and products?
  • Does the content provide relevant links to further information?

Documentation team review checklist

  • Is the content free from typos?
  • Does the content use plain English?
  • Does the content contain clear sections for concepts, tasks, and references?
  • Have any images been uploaded to the correct location, and are resolvable?
  • If the page index was updated, are redirects required
    and have they been implemented?
  • Have you checked the built version of this content?

@jonatas
Copy link
Contributor

jonatas commented Oct 10, 2024

Amazing @rdmolony! @billy-the-fish will love it!

@billy-the-fish
Copy link
Contributor

I love it indeed. @atovpeko can you review please.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants