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

Query Sampling

From: Varun Kacholia <kacholia(at)gmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Query Sampling
Date: 2005-08-28 00:00:10
Message-ID: 500f006105082717002d6edf89@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-hackers
Hi everybody,
  I would like to add query sampling support to postgresql (atleast as a part of
 my project, if someone feels strongly against checking it in the main branch).
I have been going over the code and I do see a lot of sampling stuff
in backend/commands/analyze.c. However, I plan to add sampling support
to the
executor, allowing the following types of queries:

SELECT STORE, AVG(SALES) FROM TRANSACTIONS TABLESAMPLE
 BERNOULLI(10) REPEATABLE(5) GROUP BY STORE

(This is supported by DB2).

For starters I think this should be doable in the executor by cannibalizing
nodeSeqscan.c and adding sampling support to it.
However I am concerned about the planner optimizations as it might decide
to run an index scan (instead of a sequential scan) for a particular
base relation.
My question is: Is there any easy way of forcing the optimizer to
choose sequential
scan for a particular relation? (I apologize if this is documented in
the planner code
as I am still going over it).
I would appreciate any other comments.

Thanks much,
Varun

Responses

pgsql-hackers by date

Next:From: Chris BrowneDate: 2005-08-28 03:49:41
Subject: Re: Call for 7.5 feature completion
Previous:From: David FetterDate: 2005-08-27 23:50:49
Subject: == PostgreSQL Weekly News - August 27 2005 ==

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