Services
24×7×365 Technical Support
Migration to PostgreSQL
High Availability Deployment
Database Audit
Remote DBA for PostgreSQL
Products
Postgres Pro Enterprise
Postgres Pro Standard
Cloud Solutions
Postgres Extensions
Resources
Blog
Documentation
Webinars
Videos
Presentations
Community
Events
Training Courses
Books
Demo Database
Mailing List Archives
About
Leadership team
Partners
Customers
In the News
Press Releases
Press Info
Services
24×7×365 Technical Support
Migration to PostgreSQL
High Availability Deployment
Database Audit
Remote DBA for PostgreSQL
Products
Postgres Pro Enterprise
Postgres Pro Standard
Cloud Solutions
Postgres Extensions
Resources
Blog
Documentation
Webinars
Videos
Presentations
Community
Events
Training Courses
Books
Demo Database
Mailing List Archives
About
Leadership team
Partners
Customers
In the News
Press Releases
Press Info
Facebook
Downloads
Home
>
mailing lists
Can WINDOW be used? - Mailing list pgsql-performance
From
Greg Spiegelberg
Subject
Can WINDOW be used?
Date
August 13, 2010
16:44:06
Msg-id
AANLkTim5vdL6Q_Y3odgPEQAmBYrOVa=gDKzmNLko2abU@mail.gmail.com
Whole thread
Raw
Responses
Re: Can WINDOW be used?
List
pgsql-performance
Tree view
List,
I see benefits to using the 8.4 WINDOW clause in some cases but I'm having trouble seeing if I could morph the following query using it.
wxd0812=# EXPLAIN ANALYZE
wxd0812-# SELECT * FROM
wxd0812-# (SELECT DISTINCT ON (key1_id,key2_id) * FROM sid120.data ORDER BY key1_id,key2_id,time_id DESC) x
wxd0812-# WHERE NOT deleted;
QUERY PLAN
-------------------------------------------------------------------------------------------------------------------------------------------
Subquery Scan x (cost=739953.35..787617.03 rows=280375 width=52) (actual time=45520.385..55412.327 rows=391931 loops=1)
Filter: (NOT deleted)
-> Unique (cost=739953.35..782009.53 rows=560750 width=52) (actual time=45520.378..54780.824 rows=591037 loops=1)
-> Sort (cost=739953.35..753972.08 rows=5607490 width=52) (actual time=45520.374..50520.177 rows=5607490 loops=1)
Sort Key: key1_id, key2_id, time_id
-> Seq Scan on data (cost=0.00..111383.90 rows=5607490 width=52) (actual time=0.074..6579.367 rows=5607490 loops=1) Total runtime: 55721.241 ms
(7 rows)
The purpose of this query is to identify the most recent versions of key1_id & key2_id pairs according to time_id which increases over time.
TIA,
Greg
pgsql-performance
by date:
Previous
From:
"Carlo Stonebanks"
Date:
13 August 2010, 14:51:05
Subject:
Re: Very bad plan when using VIEW and IN (SELECT...*)
Next
From:
Bruce Momjian
Date:
13 August 2010, 18:17:11
Subject:
Re: Advice configuring ServeRAID 8k for performance
Есть вопросы? Напишите нам!
Соглашаюсь с условиями обработки персональных данных
I confirm that I have read and accepted PostgresPro’s
Privacy Policy
.
I agree to get Postgres Pro discount offers and other marketing communications.
✖
×
×
Everywhere
Documentation
Mailing list
List:
all lists
pgsql-general
pgsql-hackers
buildfarm-members
pgadmin-hackers
pgadmin-support
pgsql-admin
pgsql-advocacy
pgsql-announce
pgsql-benchmarks
pgsql-bugs
pgsql-chat
pgsql-cluster-hackers
pgsql-committers
pgsql-cygwin
pgsql-docs
pgsql-hackers-pitr
pgsql-hackers-win32
pgsql-interfaces
pgsql-jdbc
pgsql-jobs
pgsql-novice
pgsql-odbc
pgsql-patches
pgsql-performance
pgsql-php
pgsql-pkg-debian
pgsql-pkg-yum
pgsql-ports
pgsql-rrreviewers
pgsql-ru-general
pgsql-sql
pgsql-students
pgsql-testers
pgsql-translators
pgsql-www
psycopg
Period
anytime
within last day
within last week
within last month
within last 6 months
within last year
Sort by
date
reverse date
rank
Services
24×7×365 Technical Support
Migration to PostgreSQL
High Availability Deployment
Database Audit
Remote DBA for PostgreSQL
Products
Postgres Pro Enterprise
Postgres Pro Standard
Cloud Solutions
Postgres Extensions
Resources
Blog
Documentation
Webinars
Videos
Presentations
Community
Events
Training Courses
Books
Demo Database
Mailing List Archives
About
Leadership team
Partners
Customers
In the News
Press Releases
Press Info
By continuing to browse this website, you agree to the use of cookies. Go to
Privacy Policy
.
I accept cookies