13,155 reputation
12151
bio website
location Munich, Bavaria
age
visits member for 3 years, 8 months
seen 15 mins ago

Dec
21
comment Are CTEs multithreaded?
Postgres does not run any statement multithreaded. That includes CTEs The "concurrently" is probably only there to indicated that there is no inherent order how they are processed
Dec
20
comment Table-based custom type does not verify check constraints
Why not simply use a plain foreign key instead of defining a table as the attribute of another table (I didn't even know this was possible).
Dec
20
comment Why storing product fees in another table is preferred?
Why do you think this requires "too many" joins? What exactly defines a number of joins as "too" many?
Dec
19
comment Monitoring the Postgres query parser
If there is such a view it will be documented in the manual: postgresql.org/docs/current/static/monitoring.html
Dec
19
comment Monitoring the Postgres query parser
Not sure, but what if you use log_parser_stats = on and log_planner_stats = on in your postgresql.conf. Does that log the information you are after?
Dec
19
comment Get products of category plus all child categories till leaf nodes
Look for "recursive common table expression", e.g. in the manual: postgresql.org/docs/current/static/queries-with.html
Dec
19
comment Does MariaDB Support Materialized views?
Postgres supports materialized views
Dec
19
comment What Is the Next Best Ingredient to Add?
Which DBMS are you using? Postgres? Oracle?
Dec
18
comment DBEAVER: SQL error or missing database (near “,”: syntax error)
Does SQLite also use those dreaded backticks?
Dec
17
comment In SQL Server, can I guarantee an order without an explicit ORDER BY clause when an index seek is forced on a table with only a clustered index?
"Am I right that it will guarantee the order in this case without an order by clause" - no, absolutely not.
Dec
17
comment the <set clause>'s <multiple column assignment>
Yes, that's perfectly legal: sqlfiddle.com/#!15/711e9/1 This can also be used in e.g. a where clause: where (a,b,c) = (1,2,3)
Dec
16
comment I can't divide 2 count(*) values without returning zero
Which DBMS are you using? Postgres? Oracle?
Dec
16
comment Unique index on columns which are allowed to be NULL
Well, if it's not possible to have the same price at the same time, then you do want a unique index with an exclusion constraint as I mentioned. Did you go through the link from my second comment? As far as I can tell it is essentially the same thing as your question.
Dec
16
comment Unique index on columns which are allowed to be NULL
@ErikVandeVen: that behaviour is the way this is specified in the SQL standard. Other DBMS (not all though) work the same way.
Dec
16
comment Unique index on columns which are allowed to be NULL
Do you really allow two different prices in the same (from, to) interval? Say 42€ between 10:00 to 14:00 and 48€ between 11:00 to 13:00 (on the same day)? What is the price at 12:00 then? If you really allow that, this sounds like a terrible idea.
Dec
16
comment How to call a windows program in mysql prompt in windows
I think with "that stands still" you actually mean "that still stands". "That stands still" means "it's not moving"...
Dec
16
comment Unique index on columns which are allowed to be NULL
See here for example: dba.stackexchange.com/q/75034/1822
Dec
16
comment Unique index on columns which are allowed to be NULL
What is the goal of that index? Only having a single offer per product? Then you don't need to include the price columns at all. Unless you can have different prices for the same product for the same period (which I doubt). You probably want an exclusion constraint on valid_from, valid_to for the same product_id
Dec
13
comment Which keyword i should use?
@miracle173: you are right. The join assumes that (a,c) is unique. Thanks for pointing that out.
Dec
13
comment Which keyword i should use?
My first example creates a table with only two columns because the select list only has two columns.