Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7972553
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T07:53:51+00:00 2026-06-04T07:53:51+00:00

We are using the django-dbarray module to use arrays in postgres. I’ve been doing

  • 0

We are using the django-dbarray module to use arrays in postgres. I’ve been doing some research regarding postgres arrays, and some developers have said they wouldn’t recommend using a postgres array storing over X values. Sometimes, this is ten, and I’ve heard as many as thirty. Is there any consensus on how many values can or should be stored in an array before performance starts to taper off?

For reference, the above DB is mainly a read only DB.

We are trying to decide where we should use intermediate tables and where we should use a postgres array.

One additional related question: When creating an index against a column in a table, where that column stores array values (let’s say bigint []). I realize the values stored within the array would not be indexed, but only the array itself (I’m assuming this is something like a C pointer). How efficient is this compared to simply having an intermediate table?

We may need to create joins against the values or have some of the specific values in a where clause, and I am concerned some of the performance could degrade and we may be better off having an intermediate table whenever we may need to create a join.

Lastly, given that we are using dbarray, what is the efficiency of that vs simply using an intermediate table with the standard django ORM (assume no joins are where clauses from the above question)?

Thank you

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T07:53:52+00:00Added an answer on June 4, 2026 at 7:53 am

    PostgreSQL supports GIN and GiST indexes over intarrays, which allows you to run the queries like this:

    SELECT  *
    FROM    mytable
    WHERE   myarray @> ARRAY[1, 2]
    -- returns arrays which contain 1 AND 2
    

    or this:

    SELECT  *
    FROM    mytable
    WHERE   myarray && ARRAY[1, 2]
    -- returns arrays which contain 1 OR 2
    

    efficiently.

    The first query is somewhat hard to rewrite efficiently using normalized schema.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using django 1.4 and have seen that when you use startproject it now creates
using django 1.4 I have a model with a datetimefield. I imported django.utils.timezone to
I just started using django for development. At the moment, I have the following
I'm using django, and have a static webpage with a GET form, and about
When using django with apache which is the best server config? Should I use
I using Django and a generic view django.views.generic.create_update.create_object I have a model form wich
I am using django-userena . I have a model called UserProfile . I've added
Using Django with a PostgreSQL (8.x) backend, I have a model where I need
Im using Django 1.3.1.In my django code, i have the following template for the
I'm using django and jquery to implement authenticated sessions and Ajax requests. I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.