Skip site navigation (1) Skip section navigation (2)

Optimizing

From: "Montrone, Marc -- 7183" <marc(dot)montrone(at)novastar1(dot)com>
To: "'pgsql-sql(at)postgresql(dot)org'" <pgsql-sql(at)postgresql(dot)org>
Subject: Optimizing
Date: 2003-02-28 15:26:08
Message-ID: 6F92EBF93563D411A42200508BD97A9A05645C2A@KCNT02B (view raw)
Please advise how I can improve performance of query searching for telephone
numbers. I have a table with over a million records of phone numbers in a
single indexed field. To find one phone number takes nearly 20 seconds.
Aside from hardware upgrades, how can I improve the performance of this
query? Thank you in advance.

From: Dan Langille <dan(at)langille(dot)org>
To: "Montrone, Marc -- 7183" <marc(dot)montrone(at)novastar1(dot)com>
Cc: "'pgsql-sql(at)postgresql(dot)org'" <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Optimizing
Date: 2003-03-01 01:12:48
Message-ID: 20030228201127.M54500@xeon.unixathome.org (view raw)
On Fri, 28 Feb 2003, Montrone, Marc -- 7183 wrote:

> Please advise how I can improve performance of query searching for telephone
> numbers. I have a table with over a million records of phone numbers in a
> single indexed field. To find one phone number takes nearly 20 seconds.
> Aside from hardware upgrades, how can I improve the performance of this
> query? Thank you in advance.

Please provide the following which will help us to help you:

The output of this commend : select version();

Please prefix your query with "explain analyze" and provide us with both
the query and the output of this command.

From: Steve Crawford <scrawford(at)pinpointresearch(dot)com>
To: "Montrone, Marc -- 7183" <marc(dot)montrone(at)novastar1(dot)com>,"'pgsql-sql(at)postgresql(dot)org'" <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Optimizing
Date: 2003-03-01 01:16:42
Message-ID: 20030301011642.D1C57103C9@polaris.pinpointresearch.com (view raw)
That should be virtually instant.

First, the usual suspects: have you run "vacuum analyze" on your table? If 
not, do it and try again.

If so, please show us your table structure, index, and query - just fire up 
psql and run "\d yourtablename" and "explain <your query>" and send it to us.

Cheers,
Steve

On Friday 28 February 2003 7:26 am, Montrone, Marc -- 7183 wrote:
> Please advise how I can improve performance of query searching for
> telephone numbers. I have a table with over a million records of phone
> numbers in a single indexed field. To find one phone number takes nearly 20
> seconds. Aside from hardware upgrades, how can I improve the performance of
> this query? Thank you in advance.
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo(at)postgresql(dot)org


Privacy Policy | About PostgreSQL
Copyright © 1996-2013 The PostgreSQL Global Development Group