Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7433347
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T09:39:19+00:00 2026-05-29T09:39:19+00:00

I have SQL table for friendship requests. Table is on server – clients are

  • 0

I have SQL table for friendship requests.
Table is on server – clients are mobile phones

Table:
Key = index, int, auto increment
C1 = userA_ID
C2 = userB_ID
(C1, C2 = unique)
C3 = status (pending, accepted, declined, unfriend....)

For better practice in the mobile, for not querying all the time the entire friendship request table I store a table also in the local DB on the device.
Once table was queried – it is stored in the local DB, so if nothing was changed device does not need to do queries from the server.

So – in the app init… (or every time entering mailbox of the app of the device) Device is asking server to know if there are new messages and friendship request updates…
For messages it is simple – since each new message has a different ID and I search on server all messages where id > stored id….
But for friendship request – I update the line in the server’s DB so the index is still same index…

I thought of two options:

  1. Add Date column and check for updates done later than last check (last check will be stored in the local DB). I prefer to do the comparison on indexes and not on a date

  2. Get all friendship requests entries of the user when app inits and do compares locally

Any recommendations?
Better ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T09:39:19+00:00Added an answer on May 29, 2026 at 9:39 am

    You could add a bit column that tracks if the request has been viewed, and set it to true when you retrieve the request, then filter on that column. That would probably be slightly better performance than storing the date, and the date last retrieved, and comparing the two each time.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an SQL table with basically the following structure: PK (int, primary key),
I have an SQL table defined as below: CREATE TABLE [TestComposite] ( ID int,
I have a SQL table (Trade Mapping) with the following columns: BTF_TRADE_MAPPING_KEY int BTF_SYSTEM_CODE
I have a SQL table readings something like: id int client_id int device_id int
I have an SQL table with the following structure: Code1 - int Code2 -
I have a SQL table, which looks like this: id_question (int) | tags (varchar)
I have a sql table which holds information: id (hash) imagename string width int
I have a SQL table: CREATE TABLE [UserTable] ( [ID] [int] NULL, [Name] [nvarchar](50)
I have a SQL table with news stories and Unix timestamps. I'd like to
I have a SQL table which has a number of fields ID | Value

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.