On Fri, Jul 07, 2006 at 11:30:35AM +, Roman Neuhauser wrote:
> > With the LIMIT it might take a different approach, which
> > might be worse if you read the whole lot, but better for a limited set.
> > A fast-start plan so to speak.
>
> That looks like a better approach for a cursor.
For
# kleptog@svana.org / 2006-06-22 09:19:44 +0200:
> On Tue, Jun 20, 2006 at 02:06:19AM -0700, [EMAIL PROTECTED] wrote:
> > Such construction is very slow but when I modify SQL to:
> > OPEN cursor1 FOR SELECT * FROM alias WHERE mask>=alias_out
> > ORDER BY mask LIMIT 100;
> >
> > it works ve
On Tue, Jun 20, 2006 at 02:06:19AM -0700, [EMAIL PROTECTED] wrote:
> Such construction is very slow but when I modify SQL to:
> OPEN cursor1 FOR SELECT * FROM alias WHERE mask>=alias_out
> ORDER BY mask LIMIT 100;
>
> it works very fast. It is strange for me becuase I've understood so far
> CREATE OR REPLACE FUNCTION alias(
>v_mask alias.mask%TYPE,
>) RETURNS INT8 AS
Sorry my mistake it should be:
CREATE TABLE alias (
alias_id BIGSERIAL PRIMARY KEY,
mask VARCHAR(20) NOT NULL DEFAULT '',
Hi
I have following table:
CREATE OR REPLACE FUNCTION alias(
v_mask alias.mask%TYPE,
) RETURNS INT8 AS
with index:
CREATE INDEX alias_mask_ind ON alias(mask);
and this table has about 1 million rows.
In DB procedure I execute:
LOOP
<.