You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -71,8 +71,8 @@ select count(*) from v where coalesce(x, 0.0::float8::vops_float4) >= 0;
71
71
6
72
72
(1 row)
73
73
74
-
select unnest(t.*) from (select mcount(*) over w,mcount(x) over w,msum(x) over w,mavg(x) over w,mmin(x) over w,mmax(x) over w,x - lag(x) over w from v window w as (rows between unbounded preceding and current row)) t;
75
-
unnest
74
+
select vops_unnest(t.*) from (select mcount(*) over w,mcount(x) over w,msum(x) over w,mavg(x) over w,mmin(x) over w,mmax(x) over w,x - lag(x) over w from v window w as (rows between unbounded preceding and current row)) t;
selectcount(*),count(x),sum(x),avg(x),min(x),max(x),variance(x),var_pop(x),var_samp(x),stddev(x),stddev_pop(x),stddev_samp(x) from s where x >1.0;
15
15
selectcount(*) from v where ifnull(x, 0) >=0;
16
16
selectcount(*) from v where coalesce(x, 0.0::float8::vops_float4) >=0;
17
-
selectunnest(t.*) from (select mcount(*) over w,mcount(x) over w,msum(x) over w,mavg(x) over w,mmin(x) over w,mmax(x) over w,x - lag(x) over w from v window w as (rows between unbounded preceding and current row)) t;
17
+
selectvops_unnest(t.*) from (select mcount(*) over w,mcount(x) over w,msum(x) over w,mavg(x) over w,mmin(x) over w,mmax(x) over w,x - lag(x) over w from v window w as (rows between unbounded preceding and current row)) t;
select unnest(t.*) from (select mcount(*) over w,mcount(x) over w,msum(x) over w,mavg(x) over w,mmin(x) over w,mmax(x) over w,x - lag(x) over w
392
+
select vops_unnest(t.*) from (select mcount(*) over w,mcount(x) over w,msum(x) over w,mavg(x) over w,mmin(x) over w,mmax(x) over w,x - lag(x) over w
393
393
from v window w as (rows between unbounded preceding and current row)) t;
394
394
</pre>
395
395
@@ -562,15 +562,15 @@ <h3><a name="populating">Preparing data for VOPS</a></h3>
562
562
(no header by default). The function returns number of imported rows.
563
563
</p>
564
564
565
-
<h3><aname="unnest">Back to normal tuples</a></h3>
565
+
<h3><aname="vops_unnest">Back to normal tuples</a></h3>
566
566
<p>
567
567
A query from VOPS projection returns set of tiles. Output function of tile type is able to print content of the tile.
568
568
But in some cases it is preferable to transfer result to normal (horizontal) format where each tuple represents one record.
569
-
It can be done using <code>unnest</code> function:
569
+
It can be done using <code>vops_unnest</code> function:
570
570
</p>
571
571
<pre>
572
-
postgres=# select unnest(l.*) from vops_lineitem l where filter(l_shipdate <= '1998-12-01'::date) limit 3;
573
-
unnest
572
+
postgres=# select vops_unnest(l.*) from vops_lineitem l where filter(l_shipdate <= '1998-12-01'::date) limit 3;
573
+
vops_unnest
574
574
---------------------------------------
575
575
(1996年03月13日,17,33078.9,0.04,0.02,N,O)
576
576
(1996年04月12日,36,38306.2,0.09,0.06,N,O)
@@ -581,14 +581,14 @@ <h3><a name="unnest">Back to normal tuples</a></h3>
581
581
582
582
<h3><aname="fdw">Back to normal tables</a></h3>
583
583
<p>
584
-
As it was mentioned in previous section, <code>unnest</code> function can scatter records with VOPS types into normal records with scalar types.
584
+
As it was mentioned in previous section, <code>vops_unnest</code> function can scatter records with VOPS types into normal records with scalar types.
585
585
So it is possible to use this records in arbitrary SQL queries.
586
-
But there are two problems with unnest function:
586
+
But there are two problems with vops_unnest function:
587
587
</p>
588
588
<ol>
589
589
<li>It is not convenient to use. This function has no static knowledge about the format of output record and this is why programmer has to specify it manually,
590
590
if here wants to decompose this record.</li>
591
-
<li>PostgreSQL optimizer has completely no knowledge on result of transformation performed by unnest() function.
591
+
<li>PostgreSQL optimizer has completely no knowledge on result of transformation performed by vops_unnest() function.
592
592
This is why it is not able to choose optimal query execution plan for data retrieved from VOPS table.</li>
0 commit comments