Re: Bypassing cursors in postgres_fdw to enable parallel plans

2025-01-17 Thread Rafia Sabih
On Tue, 14 Jan 2025 at 18:33, Robert Haas wrote: > On Mon, Jan 6, 2025 at 3:52 AM Rafia Sabih > wrote: > > Now, to overcome this limitation, I have worked on this idea (suggested > by my colleague Bernd Helmle) of bypassing the cursors. The way it works is > as follows, >

Bypassing cursors in postgres_fdw to enable parallel plans

2025-01-06 Thread Rafia Sabih
t I feel hopeful that this could be a good idea and a good time to improve postgres_fdw. Looking forward to your reviews, comments, etc. -- Regards, Rafia Sabih CYBERTEC PostgreSQL International GmbH 0001-Add-a-fetch-mechanism-without-cursors.patch Description: Binary data

Re: Forbid to DROP temp tables of other sessions

2024-11-18 Thread Rafia Sabih
On Thu, 14 Nov 2024 at 09:55, Daniil Davydov <3daniss...@gmail.com> wrote: > On Wed, Oct 30, 2024 at 7:32 PM Rafia Sabih > wrote: > > > Good catch. I agree with this being an unwarranted behaviour. > > A minor comment from my end is the wording of the error message.

Re: Proposal to Enable/Disable Index using ALTER INDEX (with patch)

2024-11-05 Thread Rafia Sabih
te. > > [1] > https://www.postgresql.org/message-id/20180618215635.m5vrnxdxhxytv...@alap3.anarazel.de > [2] > https://www.postgresql.org/message-id/EF2313B8-A017-4869-9B7F-A24EDD8795DE%40gmail.com > > Thank you for bearing with me on this :D > Shayon > -- Regards, Rafia Sabih CYBERTEC PostgreSQL International GmbH

Re: Forbid to DROP temp tables of other sessions

2024-10-30 Thread Rafia Sabih
receive feedback on these fixes) + > isolation test, which shows that now any action with temp table of > other session leads to error (temp_tbl_fix.patch) > > Tests look kinda ugly, but I think it's inevitable, given that we > don't know exactly what the name of the temporar

Cleanup SubPlanstate

2024-10-29 Thread Rafia Sabih
Hello hackers, While reviewing a related patch, it came to the notice that tab_eq_funcs in the SubPlanState is not used. Hence the patch. -- Regards, Rafia Sabih CYBERTEC PostgreSQL International GmbH From 9415a530ff6557f424d9c04d7aace697d0fe2883 Mon Sep 17 00:00:00 2001 From: rafia sabih Date

Re: Trim the heap free memory

2024-09-11 Thread Rafia Sabih
l connection time) > > *With Trim :* > >> $./pgbench testc -U t1 -S -c 100 -j 100 -T 600 >> pgbench (18devel) >> starting vacuum...end. >> transaction type: >> scaling factor: 100 >> query mode: simple >> number of clients: 100 >> number of threads: 100 >> maximum number of tries: 1 >> duration: 600 s >> number of transactions actually processed: 470690787 >> number of failed transactions: 0 (0.000%) >> latency average = 0.127 ms >> initial connection time = 23.632 ms >> tps = 784511.901558 (without initial connection time) > > -- Regards, Rafia Sabih

Re: Retiring is_pushed_down

2024-09-10 Thread Rafia Sabih
040985. Nothing else has changed. > > Thanks > Richard > -- Regards, Rafia Sabih

Re: pgstattuple: fix free space calculation

2024-09-06 Thread Rafia Sabih
On Thu, 29 Aug 2024 at 16:53, Frédéric Yhuel wrote: > > > On 8/23/24 12:51, Frédéric Yhuel wrote: > > > > > > On 8/23/24 12:02, Rafia Sabih wrote: > >> On the other hand, this got me thinking about the purpose of this > >> space information. > >

Re: Trim the heap free memory

2024-08-23 Thread Rafia Sabih
free_memory(pg_backend_pid()); >> 2024-08-23 08:27:53.958 UTC [68673] LOG: trimming heap free memory of >> PID 68673 >> pg_trim_backend_heap_free_memory >> -- >> t >> (1 row) >> 02b65000-082e5000 rw-p 00:00 0 >> [heap] >> Size: 89600 kB >> KernelPageSize:4 kB >> MMUPageSize: 4 kB >> Rss:4888 kB >> Pss:4888 kB > > postgres 68673 1.2 0.0 610456 75244 ?Ss 08:26 0:01 >> postgres: postgres postgres [local] idle >> > > Looking forward to your feedback, > > Regards, > > -- > Shawn Wang > > > Now > Liked the idea. Unfortunately, at the moment it is giving compilation error -- make[4]: *** No rule to make target `memtrim.o', needed by `objfiles.txt'. Stop. -- Regards, Rafia Sabih

Re: pgstattuple: fix free space calculation

2024-08-23 Thread Rafia Sabih
On Fri, 23 Aug 2024 at 11:01, Frédéric Yhuel wrote: > > > On 8/22/24 21:56, Rafia Sabih wrote: > > I agree with the approach here. > > A minor comment here is to change the comments in code referring to the > > PageGetHeapFreeSpace. > > Thank you Rafia. Here i

Re: Redundant Result node

2024-08-22 Thread Rafia Sabih
ic.t >Output: a, b, c > (8 rows) > > attached patch for consideration. > > best regards, > Ranier Vilela > +1 for the idea of removing this redundant node. I had a look in this patch, and I was wondering if we still need sorted_path->pathtarget != target in the condition. Apart from that, - if (sorted_path->pathtarget != target) + if (sorted_path->pathtarget != target && + memcmp(sorted_path->pathtarget, target, sizeof(PathTarget)) != 0) An extra space is there, please fix it. Some regression tests should be added for this. -- Regards, Rafia Sabih

Re: pgstattuple: fix free space calculation

2024-08-22 Thread Rafia Sabih
geGetHeapFreeSpace(page); + stat->free_space += PageGetExactFreeSpace(page); -- Regards, Rafia Sabih

Re: Support tid range scan in parallel?

2024-08-22 Thread Rafia Sabih
Desc pscan; > > Function name in the comment is not consistent. > > @@ -81,6 +81,7 @@ typedef struct ParallelBlockTableScanDescData > BlockNumber phs_startblock; /* starting block number */ > pg_atomic_uint64 phs_nallocated; /* number of blocks allocated to > * workers so far. */ > + BlockNumber phs_numblock; /* max number of blocks to scan */ > } ParallelBlockTableScanDescData; > > Can this be reorganized by putting phs_numblock after phs_startblock? > > > > > > > > > > > > > > > -- > Regards > Junwang Zhao > > > -- Regards, Rafia Sabih

Re: Reducing the log spam

2024-08-15 Thread Rafia Sabih
On Thu, 25 Jul 2024 at 18:03, Laurenz Albe wrote: > Thanks for the review! > > On Wed, 2024-07-24 at 15:27 +0200, Rafia Sabih wrote: > > I liked the idea for this patch. I will also go for the default being > > an empty string. > > I went through this patch and hav

Re: Reducing the log spam

2024-07-24 Thread Rafia Sabih
an 002 patch. > > I have attached a new version that leaves the parameter empty by default. > > The patch is not motivated by my personal dislike of certain error messages. > A well-written application would not need that parameter at all. > The motivation for me is based on my dealing with customers' log files, > which are often full of messages that are only distracting from serious > problems and fill up the disk. > > But you are probably right that it would be hard to find a default setting > that nobody has quibbles with, and the default can always be changed with > a future patch. > > Yours, > Laurenz Albe -- Regards, Rafia Sabih

Re: Things I don't like about \du's "Attributes" column

2024-07-15 Thread Rafia Sabih
On Sat, 13 Jul 2024 at 14:21, Pavel Luzanov wrote: > > On 12.07.2024 12:22, Rafia Sabih wrote: > > Other thoughts came to my mind, should we have this column in \du+ > instead, maybe connection limit too. > I know in the current version we have all this in \du itself, but the

Re: Things I don't like about \du's "Attributes" column

2024-07-12 Thread Rafia Sabih
On Fri, 12 Jul 2024 at 09:06, Pavel Luzanov wrote: > > On 11.07.2024 15:07, Rafia Sabih wrote: > > This looks much better than the current version. > > Thank you, for looking into this. > > Only thing is, I find > the column name Valid until confusing. With that name I

Re: Things I don't like about \du's "Attributes" column

2024-07-11 Thread Rafia Sabih
-04' > CONNECTION LIMIT 0; > CREATE ROLE regress_du_role1 CREATEROLE CONNECTION LIMIT -1 VALID UNTIL > 'infinity'; > CREATE ROLE regress_du_role2 LOGIN REPLICATION BYPASSRLS CONNECTION LIMIT 42; > CREATE ROLE regress_du_admin LOGIN SUPERUSER CREATEROLE CREATEDB BYPASSRLS > REPLICATION INHERIT; > COMMENT ON ROLE regress_du_admin IS 'some description'; > > -- > Pavel Luzanov > Postgres Professional: https://postgrespro.com -- Regards, Rafia Sabih

Re: Possible incorrect row estimation for Gather paths

2024-07-10 Thread Rafia Sabih
-> Parallel Seq Scan on simple r (cost=0.00..299.65 > rows=11765 width=4) > -> Parallel Hash (cost=167.01..167.01 rows=1 width=4) >-> Parallel Seq Scan on extremely_skewed s > (cost=0.00..167.01 rows=1 width=4) > > The FinalizeAggregate plan has an increased cost of 1 post patch due to the > number of rows in the Gather node that went from 1 to 2 (rint(1 * 1.7)=2). > This was enough to make the Agggregate plan cheaper. The test is to check the > parallel hash join so updating it with the new cheapest plan looked fine. > > Regards, > Anthonin > > [1]: https://github.com/bonnefoa/postgres/tree/plan-candidates -- Regards, Rafia Sabih

Re: Add connection active, idle time to pg_stat_activity

2021-11-16 Thread Rafia Sabih
On Mon, 15 Nov 2021 at 12:40, Dilip Kumar wrote: > > On Mon, Nov 15, 2021 at 4:46 PM Rafia Sabih wrote: > > > > On Mon, 15 Nov 2021 at 10:24, Dilip Kumar wrote: > > > > > > On Wed, Nov 10, 2021 at 1:47 PM Rafia Sabih > > > wrote: > > > &

Re: Add connection active, idle time to pg_stat_activity

2021-11-15 Thread Rafia Sabih
On Mon, 15 Nov 2021 at 10:24, Dilip Kumar wrote: > > On Wed, Nov 10, 2021 at 1:47 PM Rafia Sabih wrote: > > > > > It seems that in beentry->st_idle_time, you want to compute the > > > STATE_IDLE, but that state is not handled in the outer "if", th

Re: ORDER BY logic in PostgreSQL source code

2021-11-10 Thread Rafia Sabih
, by telling me which files should I take a look at? > > Thanks in advance! I think you can start by looking into the function grouping_planner and explore further by going through the route of it. -- Regards, Rafia Sabih

Re: Add connection active, idle time to pg_stat_activity

2021-11-10 Thread Rafia Sabih
On Wed, 10 Nov 2021 at 09:05, Dilip Kumar wrote: > > On Tue, Nov 9, 2021 at 8:28 PM Rafia Sabih wrote: > > > > On Tue, 2 Nov 2021 at 09:00, Dilip Kumar wrote: > > > > > > > About the patch, IIUC earlier all the idle time was accumulated in the > > &g

Re: Add connection active, idle time to pg_stat_activity

2021-11-09 Thread Rafia Sabih
On Tue, 2 Nov 2021 at 09:00, Dilip Kumar wrote: > > On Tue, Oct 26, 2021 at 5:17 PM Rafia Sabih wrote: > > > > > > > > To provide this information I was digging into how the statistics > > > collector is working and found out there is already information

Re: Add connection active, idle time to pg_stat_activity

2021-10-26 Thread Rafia Sabih
On Fri, 22 Oct 2021 at 10:22, Rafia Sabih wrote: > > Hello there hackers, > > We at Zalando have faced some issues around long running idle > transactions and were thinking about increasing the visibility of > pg_stat_* views to capture them easily. What I found is t

Add connection active, idle time to pg_stat_activity

2021-10-22 Thread Rafia Sabih
]. Ideally, this would be the values we would like to see per process in pg_stat_activity. Curious to know your thoughts on this. [1]https://github.com/postgres/postgres/blob/cd3f429d9565b2e5caf0980ea7c707e37bc3b317/src/backend/utils/activity/backend_status.c#L593 -- Regards, Rafia Sabih

Re: Position of ClientAuthentication hook

2021-06-16 Thread Rafia Sabih
On Mon, 14 Jun 2021 at 21:04, Robert Haas wrote: > > On Mon, Jun 14, 2021 at 8:51 AM Rafia Sabih wrote: > > I have a doubt regarding the positioning of clientAuthentication hook > > in function ClientAuthentication. Particularly, in case of hba errors, > > i.e. cases uaRe

Position of ClientAuthentication hook

2021-06-14 Thread Rafia Sabih
;t we process the hook function first and then error out...? -- Regards, Rafia Sabih

Re: Parallel copy

2020-07-12 Thread Rafia Sabih
those changes and then run for all parallel copy files. I think > we better run pg_indent, for all the parallel copy patches once and > for all, maybe just before we kind of finish up all the code reviews. > > > + if (mode == 1) > > + { > > + cstate->pcdata->curr_data_block = data_block; > > + cstate->raw_buf_index = 0; > > + } > > + else if(mode == 2) > > + { > > Could use macros for 1 & 2 for better readability. > > Done. > > > > > + > > + if (following_block_id == -1) > > + break; > > + } > > + > > + if (following_block_id != -1) > > + > > pg_atomic_add_fetch_u32(&pcshared_info->data_blocks[following_block_id].unprocessed_line_parts, > > 1); > > + > > + *line_size = *line_size + > > tuple_end_info_ptr->offset + 1; > > + } > > We could calculate the size as we parse and identify one record, if we > > do that way this can be removed. > > > > Done. Hi Bharath, I was looking forward to review this patch-set but unfortunately it is showing a reject in copy.c, and might need a rebase. I was applying on master over the commit- cd22d3cdb9bd9963c694c01a8c0232bbae3ddcfb. -- Regards, Rafia Sabih

Re: Columns correlation and adaptive query optimization

2020-03-25 Thread Rafia Sabih
e benefit it gives in terms of accuracy. - I would also be interested in understanding if there are cases when adding this extra step doesn’t help and have you excluded them already or if some of them are easily identifiable at this stage...? - is there any limit on the number of columns for which this will work, or should there be any such limit...? -- Regards, Rafia Sabih

Re: adding partitioned tables to publications

2020-01-28 Thread Rafia Sabih
t happen, so shouldn't there be some notice about it. -GetPublicationRelations(Oid pubid) +GetPublicationRelations(Oid pubid, bool include_partitions) How about having an enum here with INCLUDE_PARTITIONS, INCLUDE_PARTITIONED_REL, and SKIP_PARTITIONS to address the three possibilities and avoiding reiterating through the list in pg_get_publication_tables(). -- Regards, Rafia Sabih

Re: [Logical Replication] TRAP: FailedAssertion("rel->rd_rel->relreplident == REPLICA_IDENTITY_DEFAULT || rel->rd_rel->relreplident == REPLICA_IDENTITY_FULL || rel->rd_rel->relreplident == REPLICA_IDE

2020-01-09 Thread Rafia Sabih
FAULT || > rel->rd_rel->relreplident == REPLICA_IDENTITY_FULL || > - rel->rd_rel->relreplident == REPLICA_IDENTITY_INDEX); > + rel->rd_rel->relreplident == REPLICA_IDENTITY_INDEX || > + rel->rd_rel->relreplident == REPLICA_IDENTITY_NOTHING); > > /* use Oid as relation identifier */ > pq_sendint32(out, RelationGetRelid(rel)); > +1 -- Regards, Rafia Sabih

Re: adding partitioned tables to publications

2020-01-07 Thread Rafia Sabih
or all tables options. -- Regards, Rafia Sabih

Re: adding partitioned tables to publications

2020-01-06 Thread Rafia Sabih
ip already mentioned, there is a rebase required particularly for 0003 and 0004. -- Regards, Rafia Sabih

Re: Minor comment fixes for instrumentation.h

2019-12-05 Thread Rafia Sabih
On Thu, 5 Dec 2019 at 14:45, Robert Haas wrote: > > On Tue, Dec 3, 2019 at 8:36 AM Rafia Sabih wrote: > > While going through this file I noticed some inconsistencies in the > > comments. Please find attachment for the fix. > > Committed. I think only the duplicated wo

Minor comment fixes for instrumentation.h

2019-12-03 Thread Rafia Sabih
Hello, While going through this file I noticed some inconsistencies in the comments. Please find attachment for the fix. -- Regards, Rafia Sabih diff --git a/src/include/executor/instrument.h b/src/include/executor/instrument.h index 70d8632305..13aaf05453 100644 --- a/src/include/executor

Re: How to prohibit parallel scan through tableam?

2019-11-28 Thread Rafia Sabih
, how can I inform optimizer that > parallel scan is not possible (because table data is local to the backend)? > > One moment, isn't that parallel scans are already restricted for temp tables, or I have misunderstood something here...? -- Regards, Rafia Sabih

Re: How to prohibit parallel scan through tableam?

2019-11-27 Thread Rafia Sabih
, how can I inform optimizer that > parallel scan is not possible (because table data is local to the backend)? > > How about setting parallel_setup_cost to disable_cost in costsize.c for your specific scan method. -- Regards, Rafia Sabih

Re: Performance improvement for queries with IN clause

2019-11-11 Thread Rafia Sabih
On Sat, 9 Nov 2019 at 12:52, Andreas Karlsson wrote: > On 11/8/19 2:52 PM, Rafia Sabih wrote: > > Now, my question is shouldn't we always use this list in sorted order, > > in other words can there be scenarios where such a sorting will not > > help? I am talking abou

Performance improvement for queries with IN clause

2019-11-08 Thread Rafia Sabih
ys to accomplish this. So, your thoughts, opinions, suggestions are more than welcome. -- Regards, Rafia Sabih

Re: Parallel leader process info in EXPLAIN

2019-11-07 Thread Rafia Sabih
node even without verbose, but for scans it is only with verbose. Am I missing something or there is something behind? However, I am not sure if this is the introduced by this patch-set. -- Regards, Rafia Sabih

Re: adding partitioned tables to publications

2019-11-04 Thread Rafia Sabih
publisher. I was expecting more like an error at subscriber saying the table type is not same. Please find the attached file for the test case, in case something is unclear. -- Regards, Rafia Sabih -- publisher create table t (i int, j int, k text) partition by range(i); create table child1 pa

Re: adding partitioned tables to publications

2019-10-10 Thread Rafia Sabih
se only normal tables were to be replicated, but with the extension of the scope of logical replication to more objects such checks would be helpful. On a separate note was thinking for partitioned tables, wouldn't it be cleaner to have something like you create only partition table at the subscriber and then when logical replication starts it creates the child tables accordingly. Or would that be too much in future...? -- Regards, Rafia Sabih

Re: pgbench - allow to create partitioned tables

2019-10-01 Thread Rafia Sabih
y the right database or host and it has nothing to > do with initialization. > > Maybe something like: > > "pgbench_accounts is missing, perhaps you need to initialize (\"pgbench > -i\") in database \"%s\"\n" > > The two sentences approach has the logic of "error" and a separate "hint" > which is often used. > +1 for error and hint separation. -- Regards, Rafia Sabih

Re: pgbench - allow to create partitioned tables

2019-10-01 Thread Rafia Sabih
n't look quite right. I mean to say > whatever we want to say via this message is correct, but I am not > completely happy with the display part. How about something like: > "pgbench_accounts is missing, you need to do initialization (\"pgbench > -i\") in database \"%s\"\n"? Feel free to propose something else on > similar lines? If possible, I want to convey this information in a single > sentence. > > How about, "pgbench_accounts is missing, initialize (\"pgbench -i\") in database \"%s\"\n"? > -- Regards, Rafia Sabih

Re: [PATCH] Incremental sort (was: PoC: Partial sort)

2019-09-04 Thread Rafia Sabih
ra/incremental-sort-tests-2 > > There's also a spreadsheet with a summary of results, with a visual > representation of which GUCs affect which queries. > > Wow, that sounds like an elaborate experiment. But where is this spreadsheet you mentioned ? -- Regards, Rafia Sabih

Re: Creating partitions automatically at least on HASH?

2019-08-27 Thread Rafia Sabih
artition has to be created the relevant information is first entered in this structure before actually creating it. > I think it is extensible to other partitioning schemes as well. Also it > > is likely to have a positive impact on the queries, because there will > > be required partitions only and would not require to educate > > planner/executor about many empty partitions. > > Yep, but it creates other problems to solve… > > Isn't it always the case. :) -- Regards, Rafia Sabih

Re: Creating partitions automatically at least on HASH?

2019-08-26 Thread Rafia Sabih
r example, first parent table is created and it's interval and start and end values are specified and it creates only the parent table just like it works today. Now, if there comes a insertion that does not belong to the existing (or any, in the case of first insertion) partition(s), then the corresponding partition is created, I think it is extensible to other partitioning schemes as well. Also it is likely to have a positive impact on the queries, because there will be required partitions only and would not require to educate planner/executor about many empty partitions. [1] https://www.postgresql.org/message-id/flat/20190820205005.GA25823%40alvherre.pgsql#c67245b98e2cfc9c3bd261f134d05368 -- Regards, Rafia Sabih

Improve default partition

2019-08-20 Thread Rafia Sabih
default is something that remains there by default, isn't it? I will be happy to know your thoughts on this. -- Regards, Rafia Sabih

Re: Resume vacuum and autovacuum from interruption and cancellation

2019-08-08 Thread Rafia Sabih
evious run. A few minor things I noticed in the first look, +/* + * When a table has no indexes, save the progress every 8GB so that we can + * resume vacuum from the middle of table. When table has indexes we save it + * after the second heap pass finished. + */ +#define VACUUM_RESUME_BLK_INTERVAL 1024 /* 8MB */ Discrepancy with the memory unit here. /* No found valid saved block number, resume from the first block */ Can be better framed. -- Regards, Rafia Sabih

Re: [HACKERS] [WIP] Effective storage of duplicates in B-tree index.

2019-07-31 Thread Rafia Sabih
list. + * Caller is responsible for checking BTreeTupleIsPosting to ensure that + * it will get what he expects + */ Everything reads just fine without 'us'. /* + * This field helps us to find beginning of the remaining tuples from + * postings which follow array of offset numbers. + */ -- Regards, Rafia Sabih

Re: proposal - patch: psql - sort_by_size

2019-07-31 Thread Rafia Sabih
istAllDbs and describeTablespaces, precisely if (verbose && pset.sversion >= 90200) + { appendPQExpBuffer(&buf, ",\n pg_catalog.pg_size_pretty(pg_catalog.pg_tablespace_size(oid)) AS \"%s\"", gettext_noop("Size")); + sizefunc = "pg_catalog.pg_tablespace_size(oid)"; + } in describeTablespaces but if (verbose && pset.sversion >= 80200) + { appendPQExpBuffer(&buf, ",\n CASE WHEN pg_catalog.has_database_privilege(d.datname, 'CONNECT')\n" "THEN pg_catalog.pg_size_pretty(pg_catalog.pg_database_size(d.datname))\n" "ELSE 'No Access'\n" " END as \"%s\"", gettext_noop("Size")); + sizefunc = "pg_catalog.pg_database_size(d.datname)"; + } in listAllDbs. -- Regards, Rafia Sabih

Re: Initdb failure

2019-07-25 Thread Rafia Sabih
On Thu, 25 Jul 2019 at 16:44, Tom Lane wrote: > > Rafia Sabih writes: > > On Thu, 25 Jul 2019 at 13:50, vignesh C wrote: > >>> Initdb fails when following p

Re: Initdb failure

2019-07-25 Thread Rafia Sabih
On Thu, 25 Jul 2019 at 13:50, vignesh C wrote: > > On Thu, Jul 25, 2019 at 4:52 PM Rafia Sabih wrote: > > > > On Thu, 25 Jul 2019 at 07:39, vignesh C wrote: > > > > > > Hi, > > > > > >

Re: Initdb failure

2019-07-25 Thread Rafia Sabih
if this is already known. I am also not sure if it is known or intentional. On the other hand I also don't know if it is practical to give such long names for database directory anyway. -- Regards, Rafia Sabih

Fwd: [HACKERS] [WIP] Effective storage of duplicates in B-tree index.

2019-07-11 Thread Rafia Sabih
inue; This makes me wonder about those 'some' reasons. Caller is responsible for checking BTreeTupleIsPosting to ensure that + * he will get what he expects This can be re-framed to make the caller more gender neutral. Other than that, I am curious about the plans for its backward compatibility. -- Regards, Rafia Sabih

Re: Adaptive query optimization

2019-06-13 Thread Rafia Sabih
ori for different selectivities and at the execution time it starts with the plans one by one, starting from the lower selectivity one till the query execution completes. It might sound like too much work but it isn't, there are some theoretical guarantees to bound the worst case execution time. The trick is in choosing the plan-set and switching at the time of execution. Another good point about this is that it works smoothly for join predicates as well. Since, we are talking about this problem here, I though it might be a good idea to shed some light on such an approach and see if there is some interesting trick we might use. [1] https://dsl.cds.iisc.ac.in/publications/conference/bouquet.pdf -- Regards, Rafia Sabih

Re: [PATCH] Incremental sort (was: PoC: Partial sort)

2019-06-05 Thread Rafia Sabih
ove by Tomas. > Unrelated to all of the above: if I read the patch properly it > intentionally excludes backwards scanning. I don't see any particular > reason why that ought to be the case, and it seems like an odd > limitation for the feature should it be merged. Should that be a >

Re: Index Skip Scan

2019-06-01 Thread Rafia Sabih
------ Index Only Scan using t_market_feedcode_updated_at_idx on t (cost=0.14..0.29 rows=2 width=13) Scan mode: Skip scan Index Cond: (market = 'TEST'::text) (3 rows) Notice that in the explain statement it shows correct number of rows to be skipped. -- Regards, Rafia Sabih

Re: New EXPLAIN option: ALL

2019-05-07 Thread Rafia Sabih
how you want it to work. -- Regards, Rafia Sabih

Re: Pluggable Storage - Andres's take

2019-05-07 Thread Rafia Sabih
On Mon, 6 May 2019 at 22:39, Ashwin Agrawal wrote: > > On Mon, May 6, 2019 at 7:14 AM Andres Freund wrote: > > > > Hi, > > > > On May 6, 2019 3:40:55 AM PDT, Rafia Sabih > > wrote: > > >I was trying the toyam patch and on make check it failed with

Re: Pluggable Storage - Andres's take

2019-05-07 Thread Rafia Sabih
On Mon, 6 May 2019 at 16:14, Andres Freund wrote: > > Hi, > > On May 6, 2019 3:40:55 AM PDT, Rafia Sabih wrote: > >On Tue, 9 Apr 2019 at 15:17, Heikki Linnakangas > >wrote: > >> > >> On 08/04/2019 20:37, Andres Freund wrote: > >> >

Re: Pluggable Storage - Andres's take

2019-05-06 Thread Rafia Sabih
? > > Yeah, that would be good. I would assume it to be optional. > I was trying the toyam patch and on make check it failed with segmentation fault at static void toyam_relation_set_new_filenode(Relation rel, char persistence, TransactionId *freezeXid, MultiXactId *minmulti) { *freezeXid = InvalidTransactionId; Basically, on running create table t (i int, j int) using toytable, leads to this segmentation fault. Am I missing something here? -- Regards, Rafia Sabih

Re: make \d pg_toast.foo show its indices

2019-05-06 Thread Rafia Sabih
On Fri, 3 May 2019 at 16:27, Justin Pryzby wrote: > > On Fri, May 03, 2019 at 02:55:47PM +0200, Rafia Sabih wrote: > > On Mon, 22 Apr 2019 at 17:49, Justin Pryzby wrote: > > > > > > It's deliberate that \dt doesn't show toast tables. > > &

Re: make \d pg_toast.foo show its indices

2019-05-03 Thread Rafia Sabih
query pg_index. > > postgres=# \d pg_toast.pg_toast_2600 > TOAST table "pg_toast.pg_toast_2600" >Column | Type > +- > chunk_id | oid > chunk_seq | integer > chunk_data | bytea > Indexes: > "pg_toast_2600_index" PRIMARY KEY, btree (chunk_id, chunk_seq) > +1. -- Regards, Rafia Sabih

Re: [PATCH v1] Show whether tables are logged in \dt+

2019-05-03 Thread Rafia Sabih
On Sat, 27 Apr 2019 at 06:18, David Fetter wrote: > > On Fri, Apr 26, 2019 at 04:22:18PM +0200, Rafia Sabih wrote: > > On Fri, 26 Apr 2019 at 14:49, Rafia Sabih wrote: > > > > > > On Wed, 24 Apr 2019 at 10:30, Fabien COELHO wrote: > > > > > >

Re: Execute INSERT during a parallel operation

2019-04-26 Thread Rafia Sabih
ration. > > I wonder if there's a different hook I can use when there's a gather node? or > other ways to get around? A bit more detail on what are you trying to do exactly like what is the query you or code you are dealing with, will be helpful in providing suggestions, -- Regards, Rafia Sabih

Re: [PATCH v1] Show whether tables are logged in \dt+

2019-04-26 Thread Rafia Sabih
On Fri, 26 Apr 2019 at 14:49, Rafia Sabih wrote: > > On Wed, 24 Apr 2019 at 10:30, Fabien COELHO wrote: > > > > > > Hello David, > > > > >>> I noticed that there wasn't a bulk way to see table logged-ness in psql, > > >>> so I ma

Re: [PATCH v1] Show whether tables are logged in \dt+

2019-04-26 Thread Rafia Sabih
pdate :-)/:-( > > > Maybe you could consider adding a case for prior 9.1 version, something > like: >... case c.relistemp then 'temporary' else 'permanent' end as ... > > I was reviewing this patch and found a bug, create table t (i int); create index idx on t(i); \di+ psql: print.c:3452: printQuery: Assertion `opt->translate_columns == ((void *)0) || opt->n_translate_columns >= cont.ncolumns' failed. -- Regards, Rafia Sabih

Re: Zedstore - compressed in-core columnar storage

2019-04-11 Thread Rafia Sabih
discussions or implementations for column store Vertical > cluster index [2], Incore columnar storage [3] and [4], cstore_fdw [5] > were refered to distill down objectives and come up with design and > implementations to avoid any earlier concerns raised. Learnings from > Greenplum Database column store also leveraged while designing and > implementing the same. > > Credit: Design is moslty brain child of Heikki, or actually his > epiphany to be exact. I acted as idea bouncing board and contributed > enhancements to the same. We both are having lot of fun writing the > code for this. > > > References > 1] https://github.com/greenplum-db/postgres/tree/zedstore > 2] > https://www.postgresql.org/message-id/flat/CAJrrPGfaC7WC9NK6PTTy6YN-NN%2BhCy8xOLAh2doYhVg5d6HsAA%40mail.gmail.com > 3] > https://www.postgresql.org/message-id/flat/20150611230316.GM133018%40postgresql.org > 4] > https://www.postgresql.org/message-id/flat/20150831225328.GM2912%40alvherre.pgsql > 5] https://github.com/citusdata/cstore_fdw > 6] > https://www.postgresql.org/message-id/flat/CAOykqKfko-n5YiBJtk-ocVdp%2Bj92Apu5MJBwbGGh4awRY5NCuQ%40mail.gmail.com > 7] > https://www.postgresql.org/message-id/d0fc97bd-7ec8-2388-e4a6-0fda86d71a43%40iki.fi > > -- Regards, Rafia Sabih

Re: Zedstore - compressed in-core columnar storage

2019-04-11 Thread Rafia Sabih
t; "zedstore"? That seems to invite confusion with "zheap", especially > in parts of the world where the last letter of the alphabet is > pronounced "zed," where people are going to say zed-heap and > zed-store. Brr. > +1 on Brr. Looks like Thomas and your thought on having 'z' makes things popular/stylish, etc. is after all true, I was skeptical back then. -- Regards, Rafia Sabih

Re: Zedstore - compressed in-core columnar storage

2019-04-11 Thread Rafia Sabih
umn store also leveraged while designing and > implementing the same. > > Credit: Design is moslty brain child of Heikki, or actually his > epiphany to be exact. I acted as idea bouncing board and contributed > enhancements to the same. We both are having lot of fun writing the > code for this. > > > References > 1] https://github.com/greenplum-db/postgres/tree/zedstore > 2] > https://www.postgresql.org/message-id/flat/CAJrrPGfaC7WC9NK6PTTy6YN-NN%2BhCy8xOLAh2doYhVg5d6HsAA%40mail.gmail.com > 3] > https://www.postgresql.org/message-id/flat/20150611230316.GM133018%40postgresql.org > 4] > https://www.postgresql.org/message-id/flat/20150831225328.GM2912%40alvherre.pgsql > 5] https://github.com/citusdata/cstore_fdw > 6] > https://www.postgresql.org/message-id/flat/CAOykqKfko-n5YiBJtk-ocVdp%2Bj92Apu5MJBwbGGh4awRY5NCuQ%40mail.gmail.com > 7] > https://www.postgresql.org/message-id/d0fc97bd-7ec8-2388-e4a6-0fda86d71a43%40iki.fi > > Reading about it reminds me of this work -- TAG column storage( http://www09.sigmod.org/sigmod/record/issues/0703/03.article-graefe.pdf ). Isn't this storage system inspired from there, with TID as the TAG? It is not referenced here so made me wonder. -- Regards, Rafia Sabih

Re: explain plans with information about (modified) gucs

2019-04-01 Thread Rafia Sabih
On Fri, 29 Mar 2019 at 22:07, Tomas Vondra wrote: > On Wed, Mar 27, 2019 at 09:06:04AM +0100, Rafia Sabih wrote: > >On Tue, 26 Mar 2019 at 21:04, Tomas Vondra > >wrote: > > > >> On Mon, Mar 18, 2019 at 11:31:48AM +0100, Rafia Sabih wrote: > >> >

Re: explain plans with information about (modified) gucs

2019-03-27 Thread Rafia Sabih
On Tue, 26 Mar 2019 at 21:04, Tomas Vondra wrote: > On Mon, Mar 18, 2019 at 11:31:48AM +0100, Rafia Sabih wrote: > >On Sun, 24 Feb 2019 at 00:06, Tomas Vondra > wrote: > >> > >> Hi, > >> > >> attached is an updated patch, fixing and slightly twea

Re: [HACKERS] CLUSTER command progress monitor

2019-03-18 Thread Rafia Sabih
is difficult to solve, I'd not like to add the progress counter for > >> the sorting tuples. > >> > >> > >>>>- Progress counter for "6. rebuilding index" phase > >>>> - Should we add "index_vacuum_count"

Re: explain plans with information about (modified) gucs

2019-03-18 Thread Rafia Sabih
On Sun, 24 Feb 2019 at 00:06, Tomas Vondra wrote: > > Hi, > > attached is an updated patch, fixing and slightly tweaking the docs. > > > Barring objections, I'll get this committed later next week. > I was having a look at this patch, and this kept me wondering, +static void +ExplainShowSettings(

Re: Compressed TOAST Slicing

2018-12-02 Thread Rafia Sabih
GETARG_INT32(1); Looks like PG indentation is not followed here for n. -- Regards, Rafia Sabih EnterpriseDB: http://www.enterprisedb.com/

Re: Latest HEAD fails to build

2018-09-10 Thread Rafia Sabih
On Mon, Sep 10, 2018 at 4:10 PM, Christoph Berg wrote: > Re: Rafia Sabih 2018-09-10 8hfpxsrr6mxab54ebju...@mail.gmail.com> > > Thanks for the interest and help you offered. But I didn't quite get it, > I > > tried maintaner-clean and distclean but it didn't wor

Re: Latest HEAD fails to build

2018-09-10 Thread Rafia Sabih
On Mon, Sep 10, 2018 at 2:56 PM, Daniel Gustafsson wrote: > > On 10 Sep 2018, at 11:22, Rafia Sabih > wrote: > > > > Hi all, > > > > After pulling the the latest commit -- > > e3d77ea6b4e425093db23be492f236896dd7b501, > I am getting followi

Latest HEAD fails to build

2018-09-10 Thread Rafia Sabih
about that... -- Regards, Rafia Sabih EnterpriseDB: http://www.enterprisedb.com/

Re: Hint to set owner for tablespace directory

2018-09-02 Thread Rafia Sabih
On Fri, Aug 31, 2018 at 4:11 PM, Maksim Milyutin wrote: > On 08/31/2018 01:12 PM, Rafia Sabih wrote: > > > > On Fri, Aug 31, 2018 at 3:30 PM, Maksim Milyutin > wrote: > >> On 08/31/2018 11:55 AM, Rafia Sabih wrote: >> >> >> Adding to that this patc

Re: Hint to set owner for tablespace directory

2018-08-31 Thread Rafia Sabih
On Fri, Aug 31, 2018 at 3:30 PM, Maksim Milyutin wrote: > On 08/31/2018 11:55 AM, Rafia Sabih wrote: > > > Adding to that this patch needs a rebase. And, please don't forget to run > 'git diff --check', as it has some white-space issues. > > > git

Re: Hint to set owner for tablespace directory

2018-08-31 Thread Rafia Sabih
t forget to run 'git diff --check', as it has some white-space issues. -- Regards, Rafia Sabih EnterpriseDB: http://www.enterprisedb.com/

Re: Locking B-tree leafs immediately in exclusive mode

2018-06-11 Thread Rafia Sabih
However, the same might > happen in current master due to splits concurrent to relocks. So, I > don't expect > performance regression to be caused by this patch. > I had a look at this patch and it looks good to me. With the improvement in performance you mentioned, this optimisation looks worthy. -- Regards, Rafia Sabih EnterpriseDB: http://www.enterprisedb.com/

Re: [HACKERS] Partition-wise aggregation/grouping

2018-02-13 Thread Rafia Sabih
gates? > > As far as this setting goes, there wasn't any other query using partition-wise-agg, so, no. BTW, just an FYI, this experiment is on scale factor 20. -- Regards, Rafia Sabih EnterpriseDB: http://www.enterprisedb.com/ 18_pwa_off.out Description: Binary data

Re: Shouldn't execParallel.c null-terminate query_string in the parallel DSM?

2017-12-19 Thread Rafia Sabih
> sure the null terminator is copied? See attached proposed fix. > > Yes, I missed that. Your patch looks good to me, thanks. -- Regards, Rafia Sabih EnterpriseDB: http://www.enterprisedb.com/

Re: [HACKERS] [POC] Faster processing at Gather node

2017-12-05 Thread Rafia Sabih
leaks for the queries I tried. One may find the attached file for the test-case. -- Regards, Rafia Sabih EnterpriseDB: http://www.enterprisedb.com/ ml_test_query.sql Description: Binary data

Re: [HACKERS] [POC] Faster processing at Gather node

2017-11-23 Thread Rafia Sabih
utput for either values of parallel_leader_participation and patches. -- Regards, Rafia Sabih EnterpriseDB: http://www.enterprisedb.com/ with parallel_leader_participation = 1;

Re: [HACKERS] Parallel Append implementation

2017-11-20 Thread Rafia Sabih
/../../../src/include/port/atomics/generic.h:48 48 return ptr->value; In case this a different issue as you pointed upthread, you may want to have a look at this as well. Please let me know if you need any more information in this regard. -- Regards, Rafia Sabih EnterpriseDB: http://www.enterprisedb.com/