Questions tagged [partition]

Use this tag for questions about code that partitions data, memory, virtual machines, databases or disks.

In computing, partition may refer to

  • Disk partitioning, the division of a hard disk drive
  • Partition (database), the division of a database
  • Logical partition (virtual computing platform) (LPAR), a subset of a computer's resources, virtualized as a separate computer
  • Memory partition, a subdivision of a computer's memory, usually for use by a single job
  • Binary space partitioning

source: https://en.wikipedia.org/wiki/Partition

Note that non-programming questions about database partitioning are likely to be better received on Database Administrators and disk partitioning on Server Fault.

1547 questions
-1
votes
1 answer

Join on most recent date and by partition

I have two tables, clicks: user date a 01/10/2021 a 02/10/2021 a 03/10/2021 b 27/09/2021 c 08/10/2021 c 13/10/2021 and segment: user date segment a 26/09/2021 1 a 27/09/2021 1 a 03/10/2021 2 c 01/10/2021 5 c …
Blake
  • 41
  • 4
-1
votes
2 answers

Microsoft SQL Server 2016 - T-SQL language - 'Gaps & Islands' problem - tricky partition

I have 5 employees with ID values : 111, 222, 333, 444, 555. I have a source dataset that has data for all five of them on all calendar days between Mar 28, 2021 and Apr 5, 2021. (This is just a small sample subset of my actual data). You can use…
user3812887
  • 439
  • 12
  • 33
-1
votes
1 answer

change an algo to obtain optimal run time

I have an algorithm that does the reverse of partition Reverse-Partition(A, p, q, r) pivot = A[q] j = r i = q while j ≥ p + 1 and i ≥ p if A[j] > pivot exchange A[j] with A[i] i = i − 1 j = j − 1 I am trying to write…
henryD
  • 21
  • 3
-1
votes
1 answer

How to change names of dictionary keys and values

I have a .json file f = open("/Users/manishverma/Documents/json/neighbor-districts.json",) data=json.load(f) pprint(data) {'adilabad/Q15211': ['komram_bheem/Q28170184', 'nanded/Q692389', …
MANISH
  • 1
-1
votes
1 answer

How to find maximum group size dynamically

I want to find the maximum group size g_new if I want to partition a list of 'n' values. We can have any number of groups. I have: n values and maximum group size possible g_max. e.g. n = 110 and g_max = 25. We cannot form groups of size:…
sandeepsign
  • 539
  • 6
  • 11
-1
votes
1 answer

Extract the vendors with highest increase in total revenue from order table, divided by year/country/vendor - bigquery SQL

The original ORDERS table looks like this : order country_name date_local vendor_name gmv_local 01 Taiwan 2012-10-02 Hse A 559.6 02 Taiwan 2012-10-02 Hse B 573.5 03 Taiwan 2012-10-02 Hse A 559.6 04 Taiwan 2012-10-02 Hse…
HK Chan
  • 29
  • 7
-1
votes
2 answers

Assign flag based on cumulative running total

I have a table as shown above which is from the following query: SELECT f_id, f_datetime, (f_player1_score+f_player2_score) AS legs, SUM(f_player1_score+f_player2_score) OVER (ORDER BY f_datetime DESC) AS total_legs, …
arsenal88
  • 1,040
  • 2
  • 15
  • 32
-1
votes
2 answers

SQL calculation limited to 6 decimal points

I am trying to calculate the percent of total using partition over, and need the result to calculate beyond 6 decimal places. I have millions of records, so I need the calculation to extend beyond 6 decimal places to sum to 100% of total. I have…
Heidi
  • 19
  • 1
-1
votes
1 answer

How can I change path to new partion on second SSD?

I created partition on my second SSD. To acces it I need to write very long path. /media/ivan/8845bdd5-64ba-45be-90f6-83fd38ca946b How can I change this path to something shorter?
-1
votes
2 answers

How to tell in SQL Partition if plan was renewed without lapse?

I have the following data: PATIENT|CLIENT |START_DATE |END_DATE |CHECKLIST |PLAN 19993 7499 2017-08-18 2018-08-19 1 ZFD 19994 5994 2017-04-17 2018-04-18 1 ZRLZG 19994 5994 2017-04-17 2018-04-18 2 …
Mark McGown
  • 975
  • 1
  • 10
  • 26
-1
votes
1 answer

could not figure out how much is one extent?

i got the homework from Devops school and one of LVM question below , i am confused with extents , teacher said that it should be calculated like this : 20x25 = 500 mb --> so the partition supposed to be made about 600 mb with extra space ! But from…
mike543
  • 1
  • 1
-1
votes
1 answer

mariadb (mysql) sub partition error (total sub partition count exceeds 64)

enter image description here Hello I want to configure a partition (monthly)/subpartition (day by day) as the query above. If the total number of subpartitions exceeds 64, '(errno: 168 "Unknown (generic) error from engine")' The table is not created…
김정호
  • 3
  • 4
-1
votes
3 answers

Creating An external Table With Partitions in GCP

I am trying to creating an external table with Partition below is the reference image i am using. Here is what i am intending to do : I have files flowing into this folder: I need to query the external table based on the date : eg : select * from…
-1
votes
1 answer

Partition and group by query

I have table containing the columns: 1. ClockifyId, 2. StartTime EndTime of every Task 3. Date. 4. Duration The image is attached below My goal is to write query to calculate the total duration of every user(which is ClockifyId) of every date. As…
-1
votes
1 answer

ROW_NUMBER over PARTITION BY restart row counter between breaks

I have a list of activities that is currently ordered by user, date and time of activity, and ID. I want to generate numbers for each group set by those same fields. Using the following code, I achieve considerable accuracy. However, there's a…
A. Oli
  • 41
  • 1
  • 6