473,383 Members | 1,748 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

phpPGAdmin Indexes, what does this do?

Hi all,

I have two databases set up, one for development and one for
production. They are almost identical. I noticed that a query was
taking about 6.7 seconds to execute on the development database, but
only .08 seconds on the production database. The only difference was
there was another key for the production server (I am guessing it was an
index). So I clicked on the "Index" link in PhpPGAdmin for the id of
the table on the development database. This created another key just
like the one I had on the production. Now the query executed at .08
seconds. To further see what was going on, I removed the new index from
the dev DB and testing the query again... amazingly, too me, it was
still fast. Can anyone explain this to me? Thanks, Sean. Below is my
query:

SELECT
seasonal.id AS seasonal_id,
seasonal.title AS seasonal_title,
prod.id,
prod.title,
prod.co_title,
prod.summary,
prod.pic1,
prod.new_pic,
prod.new_date
FROM
seasonal,
xref_seasonal_prod,
prod,
prod_opt
WHERE
seasonal.home = 't'
AND xref_seasonal_prod.xref_seasonal_id = seasonal.id
AND xref_seasonal_prod.xref_prod_id = prod.id
AND prod.live = 't'
AND (prod_opt.clearan = 'f' OR (COALESCE(prod_opt.quantity,0) -
COALESCE(prod_opt.committed,0)) > 0)
AND prod_opt.xref_prod_id = prod.id
AND prod_opt.live = 't'
AND EXISTS
(
SELECT
a.id
FROM
prod_opt AS a
WHERE
a.xref_prod_id = prod.id
AND a.live = 't'
ORDER BY
a.priority
LIMIT 1
)
AND prod.mrf_only = 'f'
ORDER BY
xref_seasonal_prod.priority,
prod.title
LIMIT 3
---------------------------------
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard
Nov 12 '05 #1
1 1453
On Fri, 7 Nov 2003 14:02:55 -0800 (PST), Sean <dc*****@yahoo.com>
wrote:
To further see what was going on, I removed the new index from
the dev DB and testing the query again... amazingly, too me, it was
still fast. Can anyone explain this to me?


CREATE INDEX updates reltuples and relpages in pg_class. This might
cause the planner to choose a different plan. May I guess that you
didn't VACUUM or ANALYSE your table for a long time?

Servus
Manfred

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Nov 12 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: 7 | last post by:
I installed postgres and phppgadmin debian unstable (on ProMepis RC4) but I can't seem to access it. I type http://localhost/phppgadmin and it says file not found. Look in /var/www and sure...
0
by: Sean Gonsman | last post by:
Hi all, I have two databases set up, one for development and one for production. They are almost identical. I noticed that a query was taking about 6.7 seconds to execute on the development...
3
by: CSN | last post by:
In phppgadmin, primary keys are added/shown under "constraints". Does creating a primary key automatically create an index? No indexes are listed under phppgadmin's indexes page, but "\d table" in...
2
by: eClaire | last post by:
Hello, I'm new in this list. First, scuse me for my not very good english and please speak me in simple words ;) I had install postgresql on my debian, no problem. I have too phppgadmin and...
1
by: Daniel Secomb | last post by:
Hi, I'm using PostgreSQL 7.3.4 with phpPgAdmin 2.4.2 and the ".sql" file I'm trying to import came from a dump from a server running PostgreSQL 7.0.3. I just got this error message trying to...
2
by: Eric | last post by:
Hi, My webserver work in PHP4, safemode and it's running for years. I use Debian, kernel 2.6 since yesterday. I install psotgreSQL and PHPPGADMIN from apt-get (in .deb package) like always...
3
by: Chris Green | last post by:
I'm not sure if this is really on topic for this list but I'll start here. I'm trying to run phpPgAdmin, I've installed version 3.5, I have postgresql version 7.4.3 running on slackware 9.1. ...
2
by: John Oliver | last post by:
I have a Fedora Core 2 box with MySQL and phpMyAdmin running just fine. I want to add PostGreSQL and phpPgAdmin I installed: php-pgsql-4.3.10-2.4.i386.rpm postgresql-7.4.7-3.FC2.1.i386.rpm...
3
by: Dan99 | last post by:
I am not sure if I should post this here or in a potgre group, but I will start here. I recently got a new server and thus when I copied all the files to the new machine, I logically decided to...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.