Re: Slow query with big tables - Mailing list pgsql-performance

From Craig James
Subject Re: Slow query with big tables
Date
Msg-id CAFwQ8rcGGeVk0Gayz1QEP+VMp8AQi8O-f=OtbtR5T2OXVp8iiQ@mail.gmail.com
Whole thread Raw
In response to Re: Slow query with big tables  (Jim Nasby <Jim.Nasby@BlueTreble.com>)
Responses Re: Slow query with big tables
Re: Slow query with big tables
List pgsql-performance
On Fri, Aug 26, 2016 at 9:11 PM, Jim Nasby <Jim.Nasby@bluetreble.com> wrote:
On 8/26/16 3:26 PM, Mike Sofen wrote:
Is there way to keep query time constant as the database size grows.

No. More data == more time. Unless you find a way to break the laws of physics.

Straight hash-table indexes (which Postgres doesn't use) have O(1) access time. The amount of data has no effect on the access time. Postgres uses B-trees which have O(logN) performance. There is no "law of physics" that says Postgres couldn't employ pure hash indexes.

Craig


Should I use partitioning or partial indexes?

Neither technique is a magic bullet. I doubt either would help here.
--
Jim Nasby, Data Architect, Blue Treble Consulting, Austin TX
Experts in Analytics, Data Architecture and PostgreSQL
Data in Trouble? Get it in Treble! http://BlueTreble.com
855-TREBLE2 (855-873-2532)   mobile: 512-569-9461


--
Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance



--
---------------------------------
Craig A. James
Chief Technology Officer
eMolecules, Inc.
---------------------------------

pgsql-performance by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: Slow query with big tables
Next
From: Tom Lane
Date:
Subject: Re: Slow query with big tables