473,507 Members | 6,459 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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
---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Nov 12 '05 #1
0 956

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

Similar topics

7
5835
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...
1
1457
by: Sean | 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
4358
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
5765
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
2622
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
2145
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
3910
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
1597
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...
14
19631
by: Jeff | last post by:
This is the first time that I remember ever having too many indexes on a table, but it has happened. I have en employees table and store in many places, on tables, the id of the employee that...
3
2846
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...
0
7223
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7314
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7372
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7030
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
5041
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3191
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3179
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1540
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
758
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.